Click to See Complete Forum and Search --> : "Minimize to System Tray" implementation question - Is there a WM_MINIMIZE? or something similar?


Troy T
May 24th, 1999, 02:02 AM
I have a system tray icon, and I want to add a feature that will allow the user to NOT have to see the taskbar icon. When the user presses the minimize button, basically I want to send a "ShowWindow(SW_HIDE)" to the application to hide the taskbar icon (because the system tray icon is always there in my app).

Can anyone offer suggestions on how this is accomplished? How can I intercept (or handle) a minimize message when the user clicks the minimize button?

Thanks in advance!

- Troy

tangzibo
May 24th, 1999, 03:45 AM
You can capture the WM_SIZE message. At the function
CYourWnd::OnSize(UINT nType, int cx, int cy)
{
if( nType == SIZE_MINIMIZED)
{
......
}
}

Gerald
June 7th, 1999, 11:38 AM
You can overwrite the OnSysCommand Method and react when nID == SC_MINIMIZE. This is safer than reacting on OnSize, because it appears before the window gets minimized.

vs18920
June 7th, 1999, 12:09 PM
Trap the OnSysCommand(not available from class wizard),but u can find this implementation when u make a dialog based appln using appwizard.check for the WM_MINIMIZE status and in the IsIconic fuction call u can do the desired operation.If its a bouncer do write to me for the source code.
good night.