Minimize to Tray Button

Z

zakhirn

Anyone have code that creates a button that will Minimize Excel to the
system tray.

I do not need anything complicated like changing the minimize button or

the close button to a minimize to tray button. I have a Form that pops
up when excel loads, and I will add a command button called Minimize
that I just want to minimize excel to the system tray.


Thanks for your help.
 
M

Mattias Sjögren

Anyone have code that creates a button that will Minimize Excel to the
system tray.

There's no way to really minimize a window to the notification area
(aka system tray). The notification area contains only icons, they can
represent anything and are not necessarily associated with a specific
window. What applications do is

1) Add a notification icon with the NotifyIcon class.
2) Override the minimization of the window and hide it instead so no
animation to the taskbar appears and removes the taskbar button if
there is one.
3) Optionally, use the DrawAnimatedRects Win32 API to make it look
like the window really is getting minimized to the notification area


Mattias
 

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