Remove another app's SysTray icon?

Windows specific forum
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Remove another app's SysTray icon?

Post by jassing »

Is it possible (by knowing the owning window handle & PID) to manipulate (change/hide) its systray icon?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4997
Joined: Sun Apr 12, 2009 6:27 am

Re: Remove another app's SysTray icon?

Post by RASHAD »

Hi jassing
If you know the index of the system tray icon so it is so easy
If you do not, search the forum for enumerate systray icon by NM,luis or RASHAD

Code: Select all

  hnd = FindWindow_("Shell_TrayWnd", #Null)
  hnd = FindWindowEx_(hnd, #Null, "TrayNotifyWnd", #Null)
  hnd = FindWindowEx_(hnd,#Null, "SysPager", #Null)
  hnd = FindWindowEx_(hnd, #Null, "ToolbarWindow32", #Null)
   
  Count = SendMessage_(hnd, #TB_BUTTONCOUNT,0, 0)
  
  SendMessage_(hnd, #TB_HIDEBUTTON,index, 1)                 ;Hide  index = 0 the icon at right edge 
   Delay(2000)
  SendMessage_(hnd, #TB_HIDEBUTTON,index, 0)                 ;Show
Egypt my love
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: Remove another app's SysTray icon?

Post by jassing »

Thank you (again) Rashad!
Post Reply