Solved

Tray icon menu...

Posted on 1999-01-19
3
386 Views
Last Modified: 2010-04-02
Hi... I have a dialog based MFC app that has a static control on it. The static control displays a temperature reading that is changes at a time specified in a SetTimer function. The dialog can also be minimised to the tray. My question is this, if the user right clicks on the tray icon, how do I have the varying temperature reading as a menu item?
0
Comment
Question by:rose337
3 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 50 total points
ID: 1184508
As a menu item???  I guess it is possible using the menu manipulation APIs but I guess it is much simpler to do it by changing the tooltip of the tray icon.

Try something like:

    NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA) };

    nid.hWnd = hwnd;
    nid.uID = IDI_TRAYICON;
    nid.uFlags = NIF_TIP;
    lstrcpy(nid.szTip, "whatever...");

    Shell_NotifyIcon(NIM_MODIFY, &nid);

This is not straight Win32 API code but you can easily adapt it to MFC...

0
 

Expert Comment

by:ahTri
ID: 1184509
Hi rose , I have nothing to contribute to your question just want to know how can u make the icon sit on the system tray instead of task bar
0
 

Author Comment

by:rose337
ID: 1184510
For AHTRI
Use NOTIFYTRAYICON structure and Shell_NotifyIcon. Also, refer to a previous question I had answered on that topic a few weeks ago.
Hope that helps; cheers
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question