CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008
    Posts
    13

    Minimize console app to System Tray

    When running a console application... is there any func that allow when minimized the exe... it will minimize to System Tray instead of task bar.

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Minimize console app to System Tray

    You can use NotifyIcon class to show/hide icon in system tray, when minimizing to system tray you just have to hide the application window and show when system tray menu item is hit.

    http://www.ddj.com/windows/184416688

    http://msdn2.microsoft.com/en-us/lib...50(VS.71).aspx

    http://www.codeproject.com/KB/cs/mintraybtn.aspx
    Last edited by Krishnaa; March 7th, 2008 at 06:53 AM.
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Mar 2008
    Posts
    13

    Re: Minimize console app to System Tray

    Quote Originally Posted by Krishnaa
    You can use NotifyIcon class to show/hide icon in system tray, when minimizing to system tray you just have to hide the application window and show when system tray menu item is hit.

    http://www.ddj.com/windows/184416688

    http://msdn2.microsoft.com/en-us/lib...50(VS.71).aspx

    http://www.codeproject.com/KB/cs/mintraybtn.aspx
    All those showing in windows application... but i'm doing in console application... please help!!

  4. #4
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Minimize console app to System Tray

    The only difference in console and windows form is the window type, so I am assuming that your current and remaining problem is 'how to hide the console' while setting it to tray icon, correct ?

    You will have to go Win32 way here, using FindWindow (you know console caption) & ShowWindow API, you can use PInvoke to call Win32 API.
    Regards,
    Ramkrishna Pawar

  5. #5
    Join Date
    Feb 2005
    Posts
    568

    Re: Minimize console app to System Tray

    Quote Originally Posted by Krishnaa
    The only difference in console and windows form is the window type, so I am assuming that your current and remaining problem is 'how to hide the console' while setting it to tray icon, correct ?

    You will have to go Win32 way here, using FindWindow (you know console caption) & ShowWindow API, you can use PInvoke to call Win32 API.
    Can you provide some sample?

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