Solved

minimise to toolbar

Posted on 2000-02-20
4
228 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

771 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

11 Experts available now in Live!

Get 1:1 Help Now