Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbar hooked to child
#1
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
#2
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.
#3
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
#4
Macro Macro_AttachToChild
Code:
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
Code:
Copy      Help
;/hook ToolbarHook_AttachToChild
;...
Function ToolbarHook_AttachToChild
Code:
Copy      Help
;/
function# hWnd message wParam lParam

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

sel message
,case WM_INITDIALOG
,SetTimer hWnd 1 500 0
,
,case WM_TIMER
,sel wParam
,,case 1
,,if(IsWindowVisible(GetToolbarOwner(hWnd))) hid- hWnd; else hid hWnd
,
,case WM_DESTROY
,
#5
this worked good for me but I'm having problems with 2.3.2.8.
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
#6
This code should work in 2.3.2.8.


Forum Jump:


Users browsing this thread: 1 Guest(s)