Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Window name changed
#2
Function ToolbarHook_CloseWhenWindowNameChanges
Code:
Copy      Help
;/
function# hwnd message wParam lParam

;This function can be use with any QM toolbar as a toolbar hook function.
;Closes the toolbar when its owner window name changes.
;Just add this first line in toolbar text (1 space character at the beginning):
;;/hook ToolbarHook_CloseWhenWindowNameChanges


sel message
,case WM_INITDIALOG
,str* s1._new; SetProp(hwnd "ownerText" s1)
,s1.getwintext(GetToolbarOwner(hwnd))
,SetTimer hwnd 1 500 0
,
,case WM_TIMER
,sel wParam
,,case 1
,,s1=+GetProp(hwnd "ownerText")
,,str s2.getwintext(GetToolbarOwner(hwnd))
,,if s2!=*s1
,,,KillTimer hwnd wParam
,,,clo hwnd
,
,case WM_DESTROY
,RemoveProp(hwnd "ownerText")

example (replace the ; with a space character)
Toolbar Toolbar76
Trigger !n"WINDOWS" "CabinetWClass" "" "" "" 0x2     Help - how to add the trigger to the macro
Code:
Copy      Help
;/hook ToolbarHook_CloseWhenWindowNameChanges
button1 :out 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)