Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Z-order
#2
Set timer that manages the toolbar. The best place for it is toolbar hook function.

This macro creates toolbar. For testing I used Notepad instead of Display. It also runs every time when the window becomes active, and calls TB_AltAttach, although it is not necessary but just makes faster.
Macro
Trigger !a"Notepad" "Notepad"     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=val(_command)
int htb=win("TOOLBAR34" "QM_toolbar")
if !htb
,htb=mac("Toolbar34" win("Program Manager" "Progman")) ;;create toolbar attached to desktop
,SetProp htb "ho" hwnd
TB_AltAttach htb hwnd

Toolbar hook function. It sets timer that calls TB_AltAttach every 1 s.
Function tb_hook_alt_attach
Code:
Copy      Help
;/
function# hWnd message wParam lParam

sel message
,case WM_INITDIALOG
,SetTimer hWnd 3 1000 0
,
,case WM_TIMER
,TB_AltAttach hWnd GetProp(hWnd "ho")

Function TB_AltAttach
Code:
Copy      Help
;/
function htb ho

if(!IsWindow(ho))
,clo htb
else if(IsWindowVisible(ho) and !IsIconic(ho))
,Zorder htb GetWindow(ho GW_HWNDPREV) SWP_NOACTIVATE
,Transparent htb 256
else
,Transparent htb 0
;note: uses Transparent instead of hid because QM would unhide

First line of the toolbar.
Toolbar
Code:
Copy      Help
;/hook tb_hook_alt_attach


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)