Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. system tray

system tray

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutoriallounge
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 105393
    wrote on last edited by
    #1

    Umm I have no idea where to look to find out how to make my MFC program run in the system tray, can someone please point me in a general direction, much appreciated

    J 1 Reply Last reply
    0
    • U User 105393

      Umm I have no idea where to look to find out how to make my MFC program run in the system tray, can someone please point me in a general direction, much appreciated

      J Offline
      J Offline
      JohnJ
      wrote on last edited by
      #2

      If you want an icon in the system tray then go here[^] :-D JohnJ Time for a :java::java::java: but no :vegemite: http://www.rainbow-innov.co.uk[^]

      U 1 Reply Last reply
      0
      • J JohnJ

        If you want an icon in the system tray then go here[^] :-D JohnJ Time for a :java::java::java: but no :vegemite: http://www.rainbow-innov.co.uk[^]

        U Offline
        U Offline
        User 105393
        wrote on last edited by
        #3

        I searched through the stuff but nothing came up, who feels like a loser now :P

        D 1 Reply Last reply
        0
        • U User 105393

          I searched through the stuff but nothing came up, who feels like a loser now :P

          D Offline
          D Offline
          Dreamsky
          wrote on last edited by
          #4

          Does the code you need? ////////////////////// #define WM_SYSTRAY WM_USER +100 BEGIN_MESSAGE_MAP(CAppDlg, CDialog) //{{AFX_MSG_MAP(CAppDlg) ON_MESSAGE(WM_SYSTRAY,OnNotifyMsg) END_MESSAGE_MAP() /////////////////////////////////////////////////////////// // add to systray NOTIFYICONDATA niData; HICON hIcon; hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); niData.cbSize = sizeof(NOTIFYICONDATA); niData.hWnd = m_hWnd; niData.uID = 100; niData.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP; niData.hIcon = hIcon; niData.uCallbackMessage = WM_SYSTRAY; sprintf(niData.szTip,"app name"); Shell_NotifyIcon(NIM_DELETE ,&niData); /////////////////////////////////////////////////////////// // message handle afx_msg LRESULT CAppDlg::OnNotifyMsg(WPARAM wParam, LPARAM lParam) { switch(lParam) { case WM_LBUTTONDOWN: break; case WM_LBUTTONDBLCLK: this->OnRestore(); break; case WM_RBUTTONDOWN: .... } Our way isn't a soft-glass It is a mountain with path is rock But it goes towards, forward upward the sun.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups