When running the following, I cannot get info about Button1. If I select Button1, should it not become the focused child window and therefore be the target for GetActiveWindow> while GAW_TYPE=1?
I'm also confused why the "Title" variable in the GetActiveWindow> function is not being set to the button's handle. I have WIN_USEHANDLE set to 1.
Macro Scheduler version 10.019
Windows XP
Code: Select all
Dialog>Dialog1
Caption=Dialog1
Width=445
Height=250
Top=163
Left=27
Button=Button1,220,100,105,55,3
Button=Button2,80,100,75,25,4
Label= ,125,20,true
Label= ,125,40,true
Label= ,125,60,true
EndDialog>Dialog1
Show>dialog1
Label>Loop
GetDialogAction>dialog1,res1
If>res1=2,EOF
If>res1=3,Process
If>res1=4,Process
Wait>0.01
Goto>Loop
Label>EOF
SRT>Process
Let>WIN_USEHANDLE=1
Let>GAW_TYPE=1
GetActiveWindow>Title,ButtonX,ButtonY,ButtonW,ButtonH
Let>dialog1.mslabel1=Button X,Y Coordinate = %ButtonX%,%ButtonY%
Let>dialog1.mslabel2=Button W,H Dimension = %ButtonW%,%ButtonH%
Let>dialog1.mslabel3=Button Title = %Title%
Let>WIN_USEHANDLE=0
Let>GAW_TYPE=0
ResetDialogAction>dialog1
END>Process