|
Post by tsh73 on Aug 14, 2022 3:52:59 GMT -5
minor weird thing NOTICE allows to pass a handle instead of text but it prints nothing useful Probably it should fail / should not compile as PRINT Or could it actually be used for something?  - Notice - '#handle$' ==> a BasicProgram nomainwin open "close me" for dialog as #secondWnd #secondWnd "trapclose closeAny" wait
sub closeAny handle$ notice #handle$ 'that was really an error, meant to be next line 'notice handle$ close #handle$ end sub
Wow I made it do something new - Notice - a BasicProgramhelloThere nomainwin open "close me" for dialog as #secondWnd #secondWnd "trapclose closeAny" wait
sub closeAny handle$ notice #handle$;"helloThere" 'that was really an error, meant to be next line 'notice handle$ close #handle$ end sub
a BasicProgram helloThere nomainwin open "close me" for dialog as #secondWnd #secondWnd "trapclose closeAny" wait
sub closeAny handle$ notice #handle$;chr$(13);"helloThere" 'that was really an error, meant to be next line 'notice handle$ close #handle$ end sub
|
|
|
Post by Brandon Parker on Aug 14, 2022 17:33:13 GMT -5
Well, it looks like it is doing some internal evaluation to me...
On a side but related note, you can get the address where the window handle name is located...not that it is worth very much...
Struct myStruct, var as ptr
NoMainWin Open "My Test Window" For Window As #Test #Test "Trapclose CloseAny" Wait
Sub CloseAny handle$ myStruct.var.struct = handle$ Notice "Notice";chr$(13);"Pointer: ";myStruct.var.struct;chr$(13);"Points To: ";Winstring(myStruct.var.struct) Close #handle$ End Sub
{:0)
Brandon Parker
|
|
|
Post by Walt Decker on Aug 15, 2022 17:35:50 GMT -5
Conversly, one can do:
' OPEN "A WINDOW" FOR WINDOW AS #AWIN
CALL MSG "WINTITLE", "The name of the window is ?"
WAIT
SUB MSG Title$, Comment$
Hndl = 0 NumChrs = 0
WinName$ = ""
Hndl = HWND(#AWIN) WinName$ = SPACE$(256) CALLDLL #user32, "GetWindowTextA", Hndl AS ULONG, WinName$ AS STRUCT, NumChrs AS LONG WinName$ = LEFT$(WinName$, NumChrs) Comment$ = REPLSTR$(Comment$, "?", WinName$) NOTICE Title$ + CHR$(13) + Comment$ END SUB '
|
|