Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7561887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:16:30+00:00 2026-05-30T13:16:30+00:00

I am trying to make a small system tray program with only a context

  • 0

I am trying to make a small system tray program with only a context menu as its GUI.

However, I cannot get the tooltip to work. I properly setup NOTIFYICONDATA’s szTip and everything else seems to work…what is preventing the tooltip from showing on mouseover?

void main()
{
    int result;

    hinst = GetModuleHandle( NULL );

    memset( &wnd, 0, sizeof( wnd ) );
    wnd.cbSize = sizeof( wnd );
    wnd.lpszClassName = "MainWClass";
    wnd.lpfnWndProc = MainWProc;
    wnd.hInstance = hinst;
    result = RegisterClassEx( &wnd );

    hwnd = CreateWindowEx
        (
        0, //extended styles
        wnd.lpszClassName, //class name
        "Main Window", //window name
        WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL | WS_MINIMIZEBOX, //style tags
        CW_USEDEFAULT, //horizontal position
        CW_USEDEFAULT, //vertical position
        CW_USEDEFAULT, //width
        CW_USEDEFAULT, //height
        (HWND) NULL, //parent window
        (HMENU) NULL, //class menu
        (HINSTANCE) wnd.hInstance, //some HINSTANCE pointer
        NULL //Create Window Data?
        );

    nid.cbSize = sizeof( nid );
    nid.hWnd = hwnd;
    nid.uID = 1;
    nid.uVersion = NOTIFYICON_VERSION_4;
    nid.uCallbackMessage = WM_CONTEXTMENU;
    nid.hIcon = LoadIcon( hinst, MAKEINTRESOURCE( IDI_ICON1 ) );
    strcpy( nid.szTip, "My Tooltip!" );
    nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;

    if( ! Shell_NotifyIcon( NIM_ADD, &nid ) )
    {
        printf("Shell_NotifyIcon( NIM_ADD, &nid ) failed.\r\n");
        Sleep( INFINITE );
    }
    if( ! Shell_NotifyIcon( NIM_SETVERSION, &nid ) )
    {
        printf("Shell_NotifyIcon( NIM_SETVERSION, &nid ) failed.\r\n");
        Sleep( INFINITE );
    }

    UpdateWindow( hwnd );
    while( true )
    {
        //Dispatch for main window
        if( PeekMessage( &msg, hwnd, NULL, NULL, PM_REMOVE ) )
        {
            DispatchMessage( &msg );
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:16:31+00:00Added an answer on May 30, 2026 at 1:16 pm

    try adding the NIF_SHOWTIP flag, according to MSDN, NOTIFYICON_VERSION_4 requires that the tooltip be userdrawn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a small program that could intercept the open process of
I've been trying to get input with IUP to make a small pong game.
I'm trying to make a small program more robust and I need some help
I'm trying to make a small C++/Lua system where I would create my objects
im trying to make a small name summary function depending on the size of
I'm trying to make a small tool that makes use of the Debugger Engine
I'm currently trying to make a small application that performs different duties. Right now
I'm trying to build small web-system (url shortcutting) using nonsql Cassandra DB, the problem
I'm trying to make a small Mosaic programm, that draws squares randomly all over
I'm trying to make a judgment call in implementing a small-ish SQL Server '08

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.