Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use FindTrayIcon in exe?
#3
update to new version,but same error : "Cannot make exe. Error 1, failed."
......
--------------------------------------------------------------------------------------------------
/;;TI_HideTrayIcon
function# $tooltip hide

Hides or shows tray icon whose tooltip matches tooltip (can contain *?).
Returns 1 if successful.

tooltip - tooltip. Can contain wildcard characters (* and ?).
hide - 1 to hide, 0 to show.

EXAMPLE
HideTrayIcon "Quick*" 1
5
HideTrayIcon "Quick*" 0


int hwnd=child("" "ToolbarWindow32" "+Shell_TrayWnd" 0x1)
if(!hwnd) ret
int i=TI_FindTrayIcon(hwnd tooltip); if(i<0) ret
if(!SendMessage(hwnd TB_HIDEBUTTON i hide)) ret
Tray t.AddIcon; t.Delete ;;autosize
ret 1
--------------------------------------------------------------------------------------------------
;/;;TI_FindTrayIcon
function# hwnd $tooltip

;Returns tray toolbar control button id, or -1 if not found.
;hwnd - tray toolbar control handle.
;tooltip - tooltip. Can contain wildcard characters (* and ?).


int i n=SendMessage(hwnd TB_BUTTONCOUNT 0 0)
if(!n) ret -1

__ProcessMemory m.Alloc(hwnd 1000)
TBBUTTON b

for i 0 n
,if(!SendMessage(hwnd TB_GETBUTTON i m.address)) continue
,m.Read(&b sizeof(b))
,int t=SendMessage(hwnd TB_GETBUTTONTEXTW b.idCommand m.address+100)
,if(t<=0) continue
,str s
,m.ReadStr(s t*2 100 1)
,if(matchw(s tooltip 1)) ret b.idCommand
ret -1
--------------------------------------------------------------------------------------------------
;;Macro111
int+ hideunplug=1
TI_HideTrayIcon "*Connected*" hideunplug


BEGIN PROJECT
main_function Macro111
exe_file $my qm$\Macro111.exe
icon <default>
manifest $qm$\default.exe.manifest
res
on_before
on_after
on_run
flags 6
end_hotkey 0
guid {2F2F25E7-A705-4500-BC1D-4A8DF6E6EA19}
END PROJECT
--------------------------------------------------------------------------------------------------

I have reinsatlled the os and resinstalled qm
and just import this qml,is there any suggeations about this? thanks!


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)