Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get parent
#1
i have a toolbar with this code
Toolbar
Trigger !a"Notepad" "" "" "" "" 0x2     Help - how to add the trigger to the macro
Code:
Copy      Help
test :int+ c=val(_command);mac "test" * lightning.ico
and the macros has this code
Function test
Code:
Copy      Help
int window1=GetWindow(c GW_OWNER)
out window1
str name.getwintext(window1)
out name

what i am trying to do is get the toolbars owner window name "Notepad" when the toolbar button is clicked this is the top line of my toolbar also
Toolbar
Trigger !a"Notepad" "" "" "" "" 0x2 ?     Help - how to add the trigger to the macro
Code:
Copy      Help
;/mov 0 0 /siz 120 120 /bsiz 25 16 /set 0x425 0xFCFF /hcol 0x1EEA /transp 200 b /font E8FFFFFF000000000000000000000000BC02000000000000030201424B72697374656E20495443000000000000000000000000000000000000000000 /lock 0x15
i have tried many different ways but cant do it and its starting to irritate me thx for any help
#2
I verified that val(_command) and TriggerWindow return the toolbar handle not the owner handle. Not sure why. As an alternative, check the "Activate Owner" option (right click on toolbar) so that the Notepad window will be activated when the toolbar is used. Then, use "int+ c=win" to get the active window (Notepad).
#3
To get toolbar owner window handle when you know toolbar handle, use GetToolbarOwner.
#4
thx thats perfect again i didnt know that function


Forum Jump:


Users browsing this thread: 1 Guest(s)