You are here:

C++/Minimize to system tray

Advertisement


Question
Hi,

Yeah so it will sit by the clock in the taskbar and wont take up a space next to all the open applications. Im not very good at explaining this sorry.

Like msn messenger for example, when u close it it shrinks to by the clock

Thank you for your fast reply

Anythign else u need to know feel free to ask

Thanks again

-------------------------
Followup To
Question -
Hi There,

I have been learnign C++ for sometime now and my latest application requires me to minimize the application to the system tray.

I am using Borland C++ and have tried to googling it and have been unsucessful so far.

Anyhelp you can give would be great

Many thanks

Gareth

Answer -
Hello Gareth, thank you for the question.

Just to make sure I understand everything correctly, you have a windowed Windows application and you want to implement the minimizing and maximizing of the application window to the taskbar. Is this correct?

- Eddie

Answer
Hello Gareth, thank you for the question.

In your WndProc function, you can set up to catch you WM_SIZE event. This is sent when the window is resized. There you can use your wparam and lparam variables passed into the function. These represent the window width and height. If you do not do anything special, you can use this as the default to your swithc statement and it should handle everything accordingly:

default:
 return DefWindowProc(hWnd, message, wParam, lParam);

I hope this information was helpful.

- Eddie

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Eddie

Expertise

I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.

Experience

I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 About.com. All rights reserved.