Posts: 1,769
Threads: 410
Joined: Feb 2003
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?
Posts: 12,092
Threads: 142
Joined: Dec 2002
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.
Posts: 1,769
Threads: 410
Joined: Feb 2003
can you help me with that hook function? I just don't grok how those things work.
Posts: 12,092
Threads: 142
Joined: Dec 2002
Macro
Macro_AttachToChild
;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
;/hook ToolbarHook_AttachToChild
;...
Function
ToolbarHook_AttachToChild
;/
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
,
Posts: 1,769
Threads: 410
Joined: Feb 2003
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?
Posts: 12,092
Threads: 142
Joined: Dec 2002
This code should work in 2.3.2.8.