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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which instance of a window called this function?

Status
Not open for further replies.

Jakyll

Programmer
May 4, 2012
3
Hello,
I have two instances of a window running, each with buttons that call out to functions to manipulate properties of that form/window.

How can I tell from my function which window instance sent the event, so can control the correct window instance?

Thank you in advance,
 
When you say 'call out to functions' do you mean a global function? If so you need to send it a window parameter and then use the Classname method to find out which window it is.
Code:
// in the window named 'w_window1'
window lw_window
// assign instance to variable
lw_window = w_window1
// call function
f_do_something(lw_window, ....)

//in the function
CHOOSE CASE lw_window.classname()
  CASE 'w_window1'
      //something done here
  CASE 'w_window2'
      //something else done here
...

Matt



"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top