Archived

This topic is now archived and is closed to further replies.

Mutilating the Taskbar ... Properly

This topic is 5971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Why? Does there need to be a reason? Can''t I do it out of love? Devotion? A burning passion for the Windows shell?

Of course not.

What I am making though shall remain a secret until it is done. It can be done in as little as a week, or as long as a month, this all depends on me solving this one, single, problem. Everything else works. Everything else I know how to work. This has been really eating me. Alive. All my program is is a simple utility that will make the Windows shell that much more intuitive. I just really neeeeeeeeeeeeeeeeeeeeeeeed this one bit of blasted code to work.

Share this post


Link to post
Share on other sites