Hello,
I need to determine the location (RECT) of application windows (aka "buttons") in the system taskbar.
In Windows XP, this was possible by simply obtaining the handle to the "ToolbarWindow3 2" window that represents the taskbar and then using SendMessage to enumerate the taskbar buttons and obtain their RECTs using toolbar "TB_..." window messages. (i.e. TB_GETBUTTON, TB_GETRECT).
But now in Windows 7, the taskbar has been replaced by a new type of window with the class "MSTaskListWCla ss" instead of a "ToolbarWindow3 2". It is trivial to obtain a handle to this window. But unfortunately it is undocumented (as far as I can tell), and the TB_ window messages do not work with it.
Does anyone know how to either send messages to the MSTaskListWClas s window to obtain item info (in particular their text and RECT). OR is there an API or interface I can use to obtain this information directly?
(Note: The ITaskbarList shell interface does not provide methods (as far as I know) to enumerate the icons on the taskbar OR to obtain their text or RECT.)
If you want to know more about WHY I need this information, please read below:
I am writing an application that is a Tutorial for new Windows 7 users (or new PC/Windows users in general). Part of the tutorial demonstrates how the windows taskbar works.
A requirement for this tutorial application is to highlight (using a custom "magnifier" window I have created) certain areas of the desktop. For the segment about the taskbar, I have to "highlight" various taskbar buttons, and I have to monitor the user's mouse to see when it enters the region of a button for a specific application.
I can use the ITaskbarList interface to "flash" the button, which may be acceptable. However, there is no way for me to monitor when the users mouse hovers over the button unless I can obtain its RECT.
Thanks for any help anyone can provide!!
I need to determine the location (RECT) of application windows (aka "buttons") in the system taskbar.
In Windows XP, this was possible by simply obtaining the handle to the "ToolbarWindow3 2" window that represents the taskbar and then using SendMessage to enumerate the taskbar buttons and obtain their RECTs using toolbar "TB_..." window messages. (i.e. TB_GETBUTTON, TB_GETRECT).
But now in Windows 7, the taskbar has been replaced by a new type of window with the class "MSTaskListWCla ss" instead of a "ToolbarWindow3 2". It is trivial to obtain a handle to this window. But unfortunately it is undocumented (as far as I can tell), and the TB_ window messages do not work with it.
Does anyone know how to either send messages to the MSTaskListWClas s window to obtain item info (in particular their text and RECT). OR is there an API or interface I can use to obtain this information directly?
(Note: The ITaskbarList shell interface does not provide methods (as far as I know) to enumerate the icons on the taskbar OR to obtain their text or RECT.)
If you want to know more about WHY I need this information, please read below:
I am writing an application that is a Tutorial for new Windows 7 users (or new PC/Windows users in general). Part of the tutorial demonstrates how the windows taskbar works.
A requirement for this tutorial application is to highlight (using a custom "magnifier" window I have created) certain areas of the desktop. For the segment about the taskbar, I have to "highlight" various taskbar buttons, and I have to monitor the user's mouse to see when it enters the region of a button for a specific application.
I can use the ITaskbarList interface to "flash" the button, which may be acceptable. However, there is no way for me to monitor when the users mouse hovers over the button unless I can obtain its RECT.
Thanks for any help anyone can provide!!
Comment