Page 1 of 1

Detect TaskBar events [Resolved]

Posted: Mon Apr 15, 2024 5:51 pm
by Kwai chang caine
Hello at all

Is it possible to detect the events on the TaskBar ?

Have a good day

Re: Detect TaskBar events

Posted: Mon Apr 15, 2024 10:00 pm
by BarryG
What type of events? But yes, you can detect mouse clicks, and if it's visible, etc. Not as "events" but you can manually poll for them.

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 9:06 am
by Kwai chang caine
Hello BarryG

Thank for your answer 8)
You want to say, a dirty mouse hovered over detection like i create and use since yesterday ? :oops:

Code: Select all

hTray = FindWindow_("Shell_TrayWnd", 0) 
HwndRebar = FindWindowEx_(hTray, 0, "ReBarWindow32", 0) 
HwndTask = FindWindowEx_(HwndRebar, 0, "MSTaskSwWClass", 0) 
HwndTaskList = FindWindowEx_(HwndTask, 0, "MSTaskListWClass", 0)

Repeat 
 
 Delay(10)
 
 If GetAsyncKeyState_(#VK_LBUTTON) 
    
  GetCursorPos_(@point.POINT) 
  HandleHover = WindowFromPoint_(Point\X | (Point\Y << 32)) 
  
  If HandleHover = HwndTaskList And Not Passage
   Passage + 1
   Debug "TaskBar handle ''" + HwndTaskList + "'' is cliqued !!"
  EndIf
  
 Else
 
  Passage = 0
  
 EndIf
 
Until GetAsyncKeyState_(#VK_ESCAPE)
Yes that works, but i througt rather to a nice API :mrgreen:
Because with my cow pat code, i just can detect the click or double-click, but not the hwnd or title of icon clicked :cry:

Perhap it exist a more serious way for see if an application is minimized in the taskbar, and restored from the taskbar :idea:
I have searched all yesterday and not found something like that :|
And also it's perhaps a way if i can list all the icons in the taskbar, with a loop for see if it change ? :idea:

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 2:41 pm
by AZJIO
Kwai chang caine wrote: Tue Apr 16, 2024 9:06 am Perhap it exist a more serious way for see if an application is minimized in the taskbar, and restored from the taskbar
WM_ACTIVATE. These are the events of minimizing and maximizing a window. I don't know how to apply this to a third-party process.

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 2:57 pm
by Kwai chang caine
Hello AZJIO :wink:

Your code is for monitoring the minimze and restore, etc .. of a personal PB window by his CallBack :wink:

Me i search to monitoring all the windows and applications iconized in the taskbar
A style of hook of the TaskBar, for receive a message when something happened and have an event (An icon is adding, removing, a click is made, etc....)
It's clearly above my poor level, only a MASTER can found this style of code :oops:
It's surprising nobody need that a day :shock:
There are hooks of nearly all in the forums (Mouse, Keyboard, Explorer, etc ..) and nothing on the TaskBar... :|

So thanks when even for your kind help
Have a good day AZJIO 8)

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 4:31 pm
by AZJIO
Kwai chang caine wrote: Tue Apr 16, 2024 2:57 pm There are hooks
That's why I thought that events from windows also go through some kind of filter

SetWindowsHookEx + WH_CALLWNDPROC ?
SetWindowsHookEx + WH_SHELL + HSHELL_ACTIVATESHELLWINDOW, HSHELL_GETMINRECT, HSHELL_WINDOWACTIVATED ?
SetWindowsHookEx + CBTProc + HCBT_ACTIVATE ?

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 4:57 pm
by Kwai chang caine
I don't know anything about it, but I don't think there could be a hook for all Windows events, there are so many.
Coding this kind of rocket and again if it's possible, the day I'll know to do that, I change my nickname from "Kwai chang caine" Image
to "Master PO" Image

and i open a big temple "FREDolin" :lol:

Image

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 5:31 pm
by AZJIO

Re: Detect TaskBar events

Posted: Tue Apr 16, 2024 5:56 pm
by Kwai chang caine
Too strong AZJIO you have found what i search since yesterday :D
I have try it, and i'm not sure that works perfectly, the debug write sometime the oposite of the state :shock:
But it's when even a start
One thousand of thanks for your precious help
Have a very good end of the day