Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbar not minimizing with hwnd?
#1
Hello QM Forum,

I have run into a problem I have never encountered before. For some reason out of the blue, my toolbar has stopped hiding when I minimize the hwnd it's attached to. Ive tried reinstalling QM, making a whole new QM file in case the old one was corrupted, cleaning the QM registry for the toolbar, and changing the flags multiple times without any success. The trigger I am using to set the toolbar isn't on the toolbar macro it self, but on a function that calls the toolbar, because it does more then one thing when opening the toolbar. Here is the code example of what I'm working with.

Toolbar Toolbar
Code:
Copy      Help
;/mov 0 0 /siz 94 22 /set 0x525 0xFCFF /transp "" b
Text :mac "TO_Text" * $qm$\text.ico
Keys :mac "TO_Keys" * $qm$\keyboard.ico

Function Set_Toolbar
Trigger !cv"Notepad" "Notepad"     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=val(_command)
mac "Toolbar" id(15 hwnd)
#2
id(15 hwnd) is a child window. QM toolbars cannot be attached to child windows. Should be mac "Toolbar" hwnd
#3
OK it still works being attached to the hwnd, but is what you mean by it wont work is that it wont have full functionality?
#4
Can a child window be given permissions of a parent window? So then if the toolbar is attached to said child window the "child window" acts as if it is a top level parent window?
#5
No. Later I'll try to find or create a function that attaches a toolbar to a child window.
#6
OK thank's, will be waiting.
#7
Can you use another function with Acc objects trigger to tell when window is minimized and from there hide the toolbar?

As shown below...

Function Function47
Trigger $a 22 0 "" "Notepad"     Help - how to add the trigger to the macro
Code:
Copy      Help
function hwnd idObject idChild
out "Notepad minimized"

hid "toolbarfunction"

;...rest of code

Use Menu > Tools > Output > Log > Acc. Trigger Events to grab Acc trigger info

Will be noted as follows for example above,

16. MINIMIZESTART, WINDOW, 0
ow: class="Notepad", text="Untitled - Notepad"
ao: role=WINDOW, state=0x168000, name="Untitled - Notepad"
#8
Hello Gintaras,

I have found a way to simulate what I wanted to do before, but for some reason the toolbar keeps reappearing after hiding it. Here is the code I'm using.

Macro Macro
Code:
Copy      Help
hid win("Notepad_Toolbar" "QM_toolbar")

What I would like to do is have the toolbar disappear when the window its attached to is minimized and have it reappear when the window is restored back to its original state. I have already figured out the triggers for this to happen, but I'm not too sure on how to complete the hiding/reappearing of the toolbar effectively as normal hid+ & hid- codes aren't working properly. Any ideas?
#9
Create this function.
Function th_attach_to_child
Code:
Copy      Help
;/
function# hWnd message wParam lParam

sel message
,case WM_INITDIALOG
,SetTimer hWnd -1 200 0
,
,case WM_TIMER
,sel wParam
,,case -1
,,int w=GetToolbarOwner(hWnd)
,,int wa=GetAncestor(w 2)
,,if(w=wa) ret
,,if !IsWindow(w)
,,,clo hWnd
,,else if min(wa) or hid(wa)
,,,if(!hid(hWnd)) hid w; hid hWnd
,,else
,,,if(hid(hWnd)) hid- w; hid- hWnd

err+

First line of toolbar:
Toolbar Toolbar
Code:
Copy      Help
;/hook th_attach_to_child /mov 0 0 /siz 94 22 /set 0x525 0xFCFF /transp "" b
#10
WOW! Thank you very much Gintaras!


Forum Jump:


Users browsing this thread: 1 Guest(s)