Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get menu's parent window
#1
A toolbar triggers a macro (qm1) and a menu (Menu4). The toolbar's window can be obtained in a macro (qm1) using TriggerWindow.
The toolbar also triggers a menu (Menu4) which it triggers another macro (qm2). I wonder whether - and how - the toolbar's window can be obtained in qm2.

Any advice is mostly welcome.

Function qm1
Code:
Copy      Help
int hwnd=TriggerWindow
outw hwnd "" _s
outt _s
Function qm2
Code:
Copy      Help
int hwnd
out hwnd
Menu Menu4
Code:
Copy      Help
Run qmitem :qm2 * wait.ico
Toolbar Toolbar4
Code:
Copy      Help
Run qmitem :qm1 * wait.ico
Get menu :mac "Menu4" * undo.ico
#2
Only with a global variable. In toolbar item code set int+ g_lastUsedToolbar=TriggerWindow, then in qm2 use g_lastUsedToolbar.
#3
Many thanks indeed!


Forum Jump:


Users browsing this thread: 1 Guest(s)