|
Post by Walt Decker on Dec 15, 2020 12:57:53 GMT -5
Given a control, e. g. texteditor, does #Hndl.Txt contain the windows handle of the control?
Can a STRUCT be defined in a sub/function routine?
Are variables defined outside of any sub/function visible to subs/functions?
|
|
Tasp
Full Member
Posts: 215
|
Post by Tasp on Dec 15, 2020 13:04:22 GMT -5
Window handles can be obtained using hWnd()
Yes, I believe so.
Yes, if you use GLOBAL command within your program or passed into the SUB/FUNCTION.
GLOBAL a$
BUTTON #main.txt, "Click me", donothing, UL, 10, 10 OPEN "Window" FOR WINDOW AS #main #main, "trapclose [quit]"
a$ = "Hello" print "Button Handle: "; hWnd(#main.txt) print "Window Handle: "; hWnd(#main)
WAIT
SUB donothing handle$ PRINT "a$ = "; a$ ; " Handle$ = "; handle$ END SUB
[quit] CLOSE #main END
|
|
|
Post by Chris Iverson on Dec 15, 2020 13:40:40 GMT -5
Tasp is correct that for any control, you can generally pass that control's handle in to the HWND() function to get the corresponding Win32 window handle for that control. It may not always be as useful as you'd think, however; for the example of a texteditor, I believe that's a custom widget provided by the toolset used to create LB rather than a direct win32 text area, so some expected styles and such may not work.
|
|
|
Post by Walt Decker on Dec 15, 2020 14:14:34 GMT -5
Thank you gentlemen.
|
|