add icon to nonclient area

G

Guest

I'm sure there's been loads of posts (and answers) as to "how do I add a
system tray icon", but how can I add the sort of minimize button that looks
slightly different and sits alongside the existing minimize button, that is
(fairly obviously) intended to send the app to the system tray, whereas the
normal minimize icon just minimizes it. If you want an example, emule has got
one.

How can I do this in C#?
 
N

Nicholas Paldino [.NET/C# MVP]

Bonj,

You would have to override the handler for the WM_NCPAINT message in
your application by overriding the WndProc method. When handling it, you
would call the base class implementation (so that the client frame is
drawn), and then paint the button. You would also have to handle other
things as well, such as when the button is clicked, moved over, etc, etc.
To get these events, check out the WM_NC* messages, as they will handle the
events in that area.

Hope this helps.
 

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