Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About the System Tray
#8
hybrid

Function tray_icon_added_removed_notifications
Code:
Copy      Help
;/exe

int iconExisted=sub.TrayIconExists

int hh=SetWinEventHook(EVENT_OBJECT_CREATE EVENT_OBJECT_DESTROY 0 &sub.Hook_SetWinEventHook 0 0 WINEVENT_OUTOFCONTEXT)
opt waitmsg 1
wait -1
UnhookWinEvent hh


#sub Hook_SetWinEventHook v
function hHook event hwnd idObject idChild dwEventThread dwmsEventTime

;outw hwnd ;;debug
;out "%i %i %i" event idObject idChild

if(idObject!=-4 or !WinTest(hwnd "ToolbarWindow32")) ret
_s.getwintext(hwnd); if(_s!="User Promoted Notification Area") ret
Acc a1.FromEvent(hwnd idObject idChild)
;_s=a1.Name; out _s
int iconExists=sub.TrayIconExists(a1)
if(iconExists=iconExisted) ret
iconExisted=iconExists
OnScreenDisplay iif(iconExists "Icon added" "Icon removed") -1 0 0 0 0 0 4|8 "Safely Remove"


#sub TrayIconExists
function! [Acc&anyIcon]

Acc a1
if &anyIcon
,anyIcon.Navigate("parent" a1)
,a1.Find(a1.a "PUSHBUTTON" "Safely Remove Hardware and Eject Media" "class=ToolbarWindow32" 0x5)
else
,int w=win("" "Shell_TrayWnd")
,a1.Find(w "PUSHBUTTON" "Safely Remove Hardware and Eject Media" "class=ToolbarWindow32" 0x5)
ret !a1.NotFound

;BEGIN PROJECT
;END PROJECT


Messages In This Thread
About the System Tray - by RoryT84 - 06-10-2020, 05:16 PM
RE: About the System Tray - by InterestedNewbie - 06-18-2020, 01:19 PM
RE: About the System Tray - by Gintaras - 06-18-2020, 05:50 PM
RE: About the System Tray - by RoryT84 - 06-20-2020, 09:09 PM
RE: About the System Tray - by Gintaras - 06-21-2020, 04:56 AM
RE: About the System Tray - by RoryT84 - 06-21-2020, 08:24 PM
RE: About the System Tray - by Kevin - 06-22-2020, 04:24 PM
RE: About the System Tray - by Gintaras - 06-22-2020, 04:51 PM
RE: About the System Tray - by RoryT84 - 06-23-2020, 12:05 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)