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 6107249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:10:05+00:00 2026-05-23T14:10:05+00:00

MSDN’s documentation about Notifications and the Notification Area is pretty clear in the requirement

  • 0

MSDN’s documentation about Notifications and the Notification Area is pretty clear in the requirement for having an icon in the notification area in order to display a notification:

To display a notification, you must
have an icon in the notification
area
. In certain cases, such as
Microsoft Communicator or battery
level, that icon will already be
present. In many other cases, however,
you will add an icon to the
notification area only as long as is
needed to show the notification.

Since I do not wish to add any icon to the notification area, I was thinking of perhaps “reusing” an existing one that is most likely to be there on a typical desktop. A good candidate may be the system clock.

My questions are:

  1. How do I find/enumerate the
    NOTIFYICONDATA structure for the
    system clock (AKA “Date and Time
    Properties” when restored)?
  2. Is there a better way of
    accomplishing this (without adding
    an icon)?
  • 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-23T14:10:06+00:00Added an answer on May 23, 2026 at 2:10 pm

    Shell_NotifyIcon uses IUserNotification under the hood. I played around with it and made a utility out of it. I heard of a visually impaired sysadmin who uses it to make his scripts screen reader compatible. It is command line, it does not have a message loop.

    It is self aware, meaning that notifications sent to it will be queued (you have control over it). For that to work, I provided a IQueryContinue implementation. The project is in C++ and is open source, help yourself.

    Here is the guts of it :

     HRESULT NotifyUser(const NOTIFU_PARAM& params, IQueryContinue *querycontinue, IUserNotificationCallback *notifcallback)
     {
        HRESULT result = E_FAIL;
    
        IUserNotification *un = 0;
        IUserNotification2 *deux = 0; //French pun : "un" above stands for UserNotification but it also means 1 in French. deux means 2.
    
        //First try with the Vista/Windows 7 interface
        //(unless /xp flag is specified
        if (!params.mForceXP)
           result = CoCreateInstance(CLSID_UserNotification, 0, CLSCTX_ALL, IID_IUserNotification2, (void**)&deux);
    
        //Fall back to Windows XP
        if (!SUCCEEDED(result))
        {
           TRACE(eWARN, L"Using Windows XP interface IUserNotification\n");
           result = CoCreateInstance(CLSID_UserNotification, 0, CLSCTX_ALL, IID_IUserNotification, (void**)&un);
        }
        else
        {
           TRACE(eINFO, L"Using Vista interface IUserNotification2\n");
           un = (IUserNotification*)deux; //Rather ugly cast saves some code...
        }
    
        if (SUCCEEDED(result))
        {
           const std::basic_string<TCHAR> crlf_text(L"\\n");
           const std::basic_string<TCHAR> crlf(L"\n");
           std::basic_string<TCHAR> text(params.mText);
           size_t look = 0;
           size_t found;
    
           //Replace \n with actual CRLF pair
           while ((found = text.find(crlf_text, look)) != std::string::npos)
           {
              text.replace(found, crlf_text.size(), crlf);
              look = found+1;
           }
    
           result = un->SetIconInfo(params.mIcon, params.mTitle.c_str());
           result = un->SetBalloonInfo(params.mTitle.c_str(), text.c_str(), params.mType);
    
           //Looks like it controls what happends when the X button is
           //clicked on
           result = un->SetBalloonRetry(0, 250, 0);
    
           if (deux)
              result = deux->Show(querycontinue, 250, notifcallback);
           else
              result = un->Show(querycontinue, 250);
    
           un->Release();
        }
    
        return result;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The MSDN documentation on Object.GetHashCode() describes 3 contradicting rules for how the method should
MSDN has no information on the order preserving properties of data structures. So I've
MSDN's VS2010 Named and Optional Arguments (C# Programming Guide) tells us about optional parameters
The MSDN documentation describes the Environment.TickCount Property as the number of milliseconds since the
MSDN gives the following warning about the lock keyword in C#: In general, avoid
MSDN says about precision and scale of decimal multiplicatuion result : The result precision
Reading MSDN (and other sources) about custom report items (CRI) for reporting services 2005.
MSDN says If you provide no path, the DLL must be in the current
MSDN documentation for classes contain many inherited properties and methods. I think this is
Msdn doc for IsolatedStorageFile.IncreaseQuotaTo states that: To increase the quota, you must call this

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.