Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbar hooked to child
I have a toolbar that needs to hook to a child window in an app (kind of like Excel with 2 workbooks open). I need the toolbar tied to one of the workbooks so that when the other workbook is active it covers the toolbar. the help says to use 'mac' but that doesn't work.

isn't there a way to do this with child windows?
An old blog on QM coding and automation.

The Macro Hook
QM toolbars only minimally support child windows as owner windows. With mac you can attach a toolbar to a child window. Its position will be relative to the child window, and it will be destroyed after destroying the child window. But it will not be hidden or covered by other child windows. It's possible to hide/show the toolbar using a toolbar hook function, but not possible to insert it between child windows in Z order.
can you help me with that hook function? I just don't grok how those things work.
An old blog on QM coding and automation.

The Macro Hook
Macro Macro_AttachToChild
Copy      Help
;Open QM Options dialog and run this macro.
;Then select other tab. It hides current tab, and then ToolbarHook_AttachToChild hides the toolbar.

int w=win("Options" "#32770")
int c=child("" "#32770" w) ;;property page
mac("Toolbar_AttachToChild" c)
Toolbar Toolbar_AttachToChild
Copy      Help
;/hook ToolbarHook_AttachToChild
Function ToolbarHook_AttachToChild
Copy      Help
function# hWnd message wParam lParam

;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,SetTimer hWnd 1 500 0
,case WM_TIMER
,sel wParam
,,case 1
,,if(IsWindowVisible(GetToolbarOwner(hWnd))) hid- hWnd; else hid hWnd
this worked good for me but I'm having problems with
do you know if there's something that won't let it work with that version?
An old blog on QM coding and automation.

The Macro Hook
This code should work in

Forum Jump:

Users browsing this thread: 1 Guest(s)