Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response window 1

Status
Not open for further replies.

pgaec

Programmer
Aug 4, 2003
161
AU
Is there a way to determine the name of the window that called a response type window?

ie., windows A , B and C call window R [Type = response]. Is there any way by which I can determine which window called R [in the open event /pfc_postopen event of window R]
 
You could send the name of the calling window as a parameter to the response via an 'OpenwithParm' call.
 
hmmm, any other ideas? i already pass in another string using openwithparm()
 
Try the following:
Code:
ls_name = ClassName(ParentWindow())
 
In a MDI app, the above code returns the name of the frame (not the window which you used to open the response from).
 
If you know that windows A, B, and C in the example will be sheets in an MDI frame you can modify the statement as follows:
Code:
ls_name = ClassName(ParentWindow().GetActiveSheet())

If windows A, B, and C could be any type of window, then you would need to test the type of the parent first. For example:
Code:
Window  w_parent

w_parent = ParentWindow()
IF w_parent.WindowType = MDI! OR w_parent.WindowType = MDIHelp! THEN
     ls_name = ClassName(w_parent.GetActiveSheet())
ELSE
     ls_name = ClassName(w_parent)
END IF
 
thanks xsygy that was helpful!!
 
The fool-proof and sure-fire way to get the classname of the parentwindow is to pass the name/classname of the window that opened the response window - using OpenWithParm(). If you are already passing a string argument to the response for another purpose, you could use a structure to pass multiple arguments to the response window and access it from the PowerObjectParm in the Open! event of the response window.

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top