Solved

minimise to toolbar

Posted on 2000-02-20
4
234 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Load and store *.pnm image file 1 75
C Language combined operators 28 106
Path to  STL Map header file 1 41
passing data from one form to another form in c++ 27 75
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now