HOW TO: Win32 API - Get all windows, draw a icon and bring the windowsto the systray

  • Thread starter Christoph Engelhardt
  • Start date
C

Christoph Engelhardt

Hi newsgroup,

What I intend to do:
Write a small programm, that will add a new Button to every Window right
beside the Buttons for minimizing, maximizing and closing the window in
the window's titlebar. When this button is clicked the window itself
should be minimized to the systray

On my way there I found hardly any example via Google that suited my needs.
All I know about already is how to get all windows in VB.Net ( which
actually isn't C#, so I got a bit confused by the different syntax )

I would be thankful for *any* help that could be granted.
Especially on getting all (active ?) windows, drawing a icon onto them
and minimizing them to the systray.


Thx in advance for any help

Christoph
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

The most challenging part of your task will be creating buttons on the
windows' title bars. The thing is you'll have to subclass every window in
order to add something to it's title bar. More than that, how about windows
who have custom title bars or even window shapes?

Regarding drawing on a window's toolbar, see my reply to redneon below (the
answer fully applies if the window is a window belonging to your
application, but the idea to handle WM_NC* messages is still valid for
customizing other applications' windows).

As for minimizing to the tray, there's nothing like that in the API - you'll
have to minimize and hide the window and add an icon to the tray manually -
as well as to add handling for clicking on that icon in order to show and
restore the window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top