System Tray Icon in C++
Asked Answered
M

2

8

I got a basic window made from C++. What I need to do is whenever I click the Minimize button the window will be placed in the System Tray and whenever I double click on the Icon it will restore...

Mei answered 11/2, 2011 at 1:15 Comment(3)
Some suggestions. 1) Tag it with the platform you're targeting both OS (Windows I guess, but I don't know ) and the API system you're using 2) Show us what you do have and explain what your don't know.Narcose
I use Window XP and WinAPI.. I want to know how could I put my program to system tray whenever I minimize it.Mei
possible duplicate of How do is the Win32 API used in C++ to minimize a window to the system tray?Wariness
C
12

check msdn about a struct: NOTIFYICONDATA and a function:

BOOL Shell_NotifyIcon( DWORD dwMessage,PNOTIFYICONDATA lpdata);


and also a demo here.

Hope you can understand:)

Cadell answered 11/2, 2011 at 3:3 Comment(1)
what if I want to show/hide systems icon like network/volume/microphone?Vtehsta
A
20

You will need to use Shell_NotifyIcon to interact with the notification area (system tray).

Arcboutant answered 11/2, 2011 at 1:17 Comment(3)
how could I used Shell_NotifyIcon?Mei
what if I want to show/hide systems icon like network/volume/microphone?Vtehsta
@Vtehsta sounds like you should just ask this as a question.Arcboutant
C
12

check msdn about a struct: NOTIFYICONDATA and a function:

BOOL Shell_NotifyIcon( DWORD dwMessage,PNOTIFYICONDATA lpdata);


and also a demo here.

Hope you can understand:)

Cadell answered 11/2, 2011 at 3:3 Comment(1)
what if I want to show/hide systems icon like network/volume/microphone?Vtehsta

© 2022 - 2024 — McMap. All rights reserved.