?
Solved

minimise to toolbar

Posted on 2000-02-20
4
Medium Priority
?
282 Views
Last Modified: 2010-04-02
I have a mfc-based app that I need to have minimise itself to the windows toolbar when it starts.  Not a button on the taskbar, but on the toolbar to the right of that where the clock/volume/etc sits.
Ive looked everywhere and found tons about toolbars in general but nothing about the main windows toolbar.
Can anyone help?
0
Comment
Question by:tekwini
  • 2
4 Comments
 
LVL 1

Expert Comment

by:nutsnuts
ID: 2541183
Hi, telkwini

I think you are going to put an icon on the systray area, try the API Shell_NotifyIcon. If still any questions, just ask.
0
 
LVL 2

Expert Comment

by:bbousquet
ID: 2541185
You might want to check out www.codeguru.com - they have a number of examples / class wrappers doing just that.
0
 
LVL 3

Expert Comment

by:akalmani
ID: 2541218
HI !!
   
      hIcon = LoadIcon(IDR_MAINFRAME);//Icon for taskbar
      NOTIFYICONDATA pnid;
      pnid.cbSize = sizeof(NOTIFYICONDATA);
      pnid.hWnd = AfxGetMainWnd()->m_hWnd;
      pnid.uID = IDR_MAINFRAME;
      pnid.uFlags = NIF_ICON;
      pnid.hIcon = hIcon;
      pnid.uCallbackMessage = WM_USER1;
      ::Shell_NotifyIcon(NIM_ADD,&pnid);

       Try this it works
0
 
LVL 3

Accepted Solution

by:
akalmani earned 150 total points
ID: 2541220
HI !!
   
      hIcon = LoadIcon(IDR_MAINFRAME);//Icon for taskbar
      NOTIFYICONDATA pnid;
      pnid.cbSize = sizeof(NOTIFYICONDATA);
      pnid.hWnd = AfxGetMainWnd()->m_hWnd;
      pnid.uID = IDR_MAINFRAME;
      pnid.uFlags = NIF_ICON;
      pnid.hIcon = hIcon;
      pnid.uCallbackMessage = WM_USER1;
      ::Shell_NotifyIcon(NIM_ADD,&pnid);

       Try this it works but u have to handle the mouse clicks over it and hide the application at start.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

807 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