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. Query about Tray Icon

Query about Tray Icon

Scheduled Pinned Locked Moved C / C++ / MFC
databaselinuxtutorialquestion
3 Posts 2 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.
  • R Offline
    R Offline
    ramana g
    wrote on last edited by
    #1

    Hi all, I have developed a dialog based application. In CMyDialog::OnInitDialog() i wrote code to add TrayIcon. HICON hIcon = NULL; m_NotifyIconData.cbSize = sizeof(NOTIFYICONDATA); m_NotifyIconData.hWnd = m_hWnd; m_NotifyIconData.uID = IDR_MAINFRAME; m_NotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; m_NotifyIconData.uCallbackMessage = ID_TRAY_MESSAGE; //WM_USER + 1 hIcon = (HICON) LoadIcon(AfxGetInstanceHandl(),MAKEINTRESOURCE (IDR_MAINFRAME)); m_NotifyIconData.hIcon = hIcon; strcpy(m_NotifyIconData.szTip, "My Tray Icon"); Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData); if (hIcon) DestroyIcon(hIcon); It successfully added Tray Icon to the Notification area. My sample application is running well. But, when i kill windows "explorer.exe" process from task manager and start "explorer" again, TrayIcon is missing in Notification area. I want Tray icon to be added again in this scenario. How to do this? Thank you...

    D 1 Reply Last reply
    0
    • R ramana g

      Hi all, I have developed a dialog based application. In CMyDialog::OnInitDialog() i wrote code to add TrayIcon. HICON hIcon = NULL; m_NotifyIconData.cbSize = sizeof(NOTIFYICONDATA); m_NotifyIconData.hWnd = m_hWnd; m_NotifyIconData.uID = IDR_MAINFRAME; m_NotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; m_NotifyIconData.uCallbackMessage = ID_TRAY_MESSAGE; //WM_USER + 1 hIcon = (HICON) LoadIcon(AfxGetInstanceHandl(),MAKEINTRESOURCE (IDR_MAINFRAME)); m_NotifyIconData.hIcon = hIcon; strcpy(m_NotifyIconData.szTip, "My Tray Icon"); Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData); if (hIcon) DestroyIcon(hIcon); It successfully added Tray Icon to the Notification area. My sample application is running well. But, when i kill windows "explorer.exe" process from task manager and start "explorer" again, TrayIcon is missing in Notification area. I want Tray icon to be added again in this scenario. How to do this? Thank you...

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      ramana.g wrote:

      How to do this?

      By reading this article.

      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      R 1 Reply Last reply
      0
      • D David Crow

        ramana.g wrote:

        How to do this?

        By reading this article.

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        R Offline
        R Offline
        ramana g
        wrote on last edited by
        #3

        thank you David :)

        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