Detect TaskBar events [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5502
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Detect TaskBar events [Resolved]

Post by Kwai chang caine »

Hello at all

Is it possible to detect the events on the TaskBar ?

Have a good day
Last edited by Kwai chang caine on Tue Apr 16, 2024 5:56 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Detect TaskBar events

Post 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.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5502
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Detect TaskBar events

Post 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:
ImageThe happiness is a road...
Not a destination
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: Detect TaskBar events

Post 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.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5502
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Detect TaskBar events

Post 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)
ImageThe happiness is a road...
Not a destination
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: Detect TaskBar events

Post 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 ?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5502
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Detect TaskBar events

Post 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
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5502
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Detect TaskBar events

Post 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
ImageThe happiness is a road...
Not a destination
Post Reply