Mutilating the Taskbar ... Properly

Started by
9 comments, last by LordElectro 22 years, 8 months ago
Okay, this is actually a several question post. First and foremost, what I am attempting to do is remove a window (not necessarily belong to my application) from the Taskbar. Any Suggestions? Okay, well personally I have found two ways after 2 days of digging in the API and consuming very strong coffee: 1) Use the ITaskManager interface that the Windows Shell API provides. This allows me to remove the window from the taskbar real easy, but unfortuatenly, if someone ALT-Tabs to the window, the window gets dumped back into the taskbar. 2) Changing the extended window style to WS_EX_TOOLWINDOW. This makes the caption bar of the window smaller, which is okay. What is not okay is the removal of the SysMenu and Min and Max buttons that this style results in. This also results in minor display bugs, but if I had the damned sysmenu and min and max buttons, I wouldn''t care cause I have pretty much eradicated the display troubles. Well for number 1, if I use that solution I need some way of either removing the window from the ALT-TAB list OR detecting when the Alt-Tab was pressed OR detecting when the Taskbar has changed or something along those lines. For solution 2, well hell, I need some property or osmething that will give me my buttons back! This application I am writing runs in the background, so as long as it can be notified somehow of when the window is placed back into the taskbar, I can live with shoving it back out each time. Okay so suggestions? Ideas? This is driving me nuts and I''m just about to give up on the project, which would really bite because the program I am writing will be really useful.
BetaShare - Run Your Beta Right!
Advertisement
there should be a message sent whenever the window is brought to focus (eg: after alt-tabbing to it)... i dont konw what its called... i''m just starting out with windows programming so i dont really konw what i''m talking about...

i think the message is WM_ACTIVATE
Yea, there is such a message, but then, how do I trap messages going to that window? Because this isn''t a Window that belongs to my application...
BetaShare - Run Your Beta Right!
Investigate Hooks (SetWindowsHookEx). As far as I know this is what WindowBlinds uses to trap messages going to other windows.


Hi
Do i dont know if you want to close the window itself or only its tab button from the taskbar. I assume u wanna do the second.

Take a look at MSDN and search for the ITaskbarList interface, this is the monster which does management of the task buttons, it can add, delete and activate em for you.

--Ali Seyedof

--MFC (The Matrix Foundation Crew)
appar1tion: I did try those. I couldn''t get them to work though :/ One way caused Windows to crash in a spectacular display of error messages (and it took about 5 minutes before the system was fully crashed, so just imagine), and the other way I tried did jack. If you could explain how to call that function properly so ill receive messages for all windows...

Seyedof: As I mentioned in my post, ITaskbarList I have tried, and it is perfect minus the fact that the darned window pops back into the taskbar if it is ALT-Tab''d to. That is simply inacceptable for what I am doing
BetaShare - Run Your Beta Right!
another way to get messages going to another window is to subclass it. use GetWindowLong to retrieve and store the WNDPROC for the other window, then set your own WNDPROC in its place with SetWindowLong. just be sure to forward any messages you don''t handle to the old WNDPROC.


Fragmo: I kiss you! *



* Offer only valid this works.
BetaShare - Run Your Beta Right!
So much for Fragmo''s idea. Here it is straight from MSDN, regarding SetWindowLong() when setting the WndProc:

"Sets a new address for the window procedure.
Windows NT/2000: You cannot change this attribute if the window does not belong to the same process as the calling thread."

So that won''t work.
BetaShare - Run Your Beta Right!
I''m curious as to why you want to do this?

Why?

This topic is closed to new replies.

Advertisement