Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Get Enable State of Child Window

Keywords: 	cEnable 

Question:

Which function can return the state of a child window? To my understanding WinState only works with parent windows...

Answer:

I guess cEnable state will tell you if a window or control is enabled to accept input or not.

There is a way involving getting the HWND of the window, converting it to a Hex string (See WILX extender) and strcat'ting some characters in front to turn the hwnd of a control into a WinID number that then WinState can check the hidden/unhidden status on.

Something like:

winid=WInIdGet("WinBatch Studio") ; WinState likes these
hwnd=DllHwnd("WinBatch Studio") ; Control manager uses this kind
Message(winid,hwnd) ; show the two different types
;Convert
AddExtender("WILX34I.DLL")
hexnum=xBaseConvert(hwnd,10,16) ; convert to hex
hexnum=StrFixLeft(hexnum,"0",8)
hexnum=strcat("#WIN$ID#",hexnum)
Message(winid,hexnum)

Message("WinState",WinState(hexnum))



Article ID:   W12505
Filename:   Get Enable State of Child Window.txt