CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    WA
    Posts
    65

    "Minimize to System Tray" implementation question - Is there a WM_MINIMIZE? or something similar?

    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

  2. #2
    Join Date
    Apr 1999
    Posts
    37

    Re: "Minimize to System Tray" implementation question - Is there a WM_MINIMIZE? or something similar

    You can capture the WM_SIZE message. At the function
    CYourWnd::OnSize(UINT nType, int cx, int cy)
    {
    if( nType == SIZE_MINIMIZED)
    {
    ......
    }
    }


  3. #3
    Join Date
    Apr 1999
    Posts
    3

    Re: "Minimize to System Tray" implementation question - Is there a WM_MINIMIZE? or something similar

    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.


  4. #4
    Join Date
    Jun 1999
    Posts
    2

    Re: "Minimize to System Tray" implementation question - Is there a WM_MINIMIZE? or something similar

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured