Re: Global variables for multiple child windows

new topic     » goto parent     » topic index » view thread      » older message » newer message

Rad wrote:
> 
> Hi,
> 
> I have multiple child windows which have to setup a few global variables when
> they -
> 
> 1] open
> 2] get focus
> 3] are re-sized - maximized (after being minimized first)
> 4] moved around - moveZOrder(window, HWND_TOP) or dragged around
> 
> I am using a procedure in each window as follows:
> 
> }}}
<eucode>
> global integer MaintWin, MaintStatBar
> global sequence ProcModes, UpdtProc, SelCtl
> 
> procedure setSocMaintPars(integer self, integer event, sequence params)
> 	MaintWin     = self
> 	MaintStatBar = StatusBar380
> 	ProcModes    = SocProcModes
> 	UpdtProc     = SocUpdtProc
> 	SelCtl       = SocSelCtl
> 	
> 	setMaintModes()
> end procedure
> setHandler(SocMaint, {w32HGotFocus, w32HResize, w32HPaint},
> routine_id("setSocMaintPars"))
> </eucode>
{{{

> 
> Each window has a similar procedure, where global variables acquire window
> specific
> values.
> This procedure works fine except when I have multiple windows open
> simultaneously.
> When the top most window is dragged around, the values of the window which is
> overlapped by the dragged one always gets stored in global variables.
> 
> Is there a way to always load the global variables with the values for top
> most
> child window? How to get the id of top most child window?
> 
> Regards,
> Rad.

I assume you are using win32lib:
constant GW_CHILD = 5

myTopChildWindow=getId(w32Func(xGetWindow,{getHandle(myMainWindow),GW_CHILD}))

If you don't, check that the GetWindow API is being wrapped, and wrap it if
needed. It's wrapped in win32lib as
xGetWindow          = registerw32Function( user32, "GetWindow",
{C_LONG, C_LONG}, C_LONG)


CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu