Expand/Collapse System Notification Area programmatically.
![]()
Windows system task bar have System notification area. There is an arrow button nearby that by which we can Expand or collapse the System notification Area. Did you notice that while minimizing yahoo messenger, it displays a message that “Yahoo messenger will be still running in the system tray”. While displaying such as message, it will be nice to animate the Notification area by expanding and collapsing it.
![]()
See the code snippet. I guess, its self explanatory.
// Find the Shell Tray Window.
HWND hTrayWnd = ::FindWindowEx( 0,
0,
_T("Shell_TrayWnd"),
_T(""));
// Find the Tray notification window,
// which is a child of ShellTrayWidnow.
HWND hTrayNotifyWnd = ::FindWindowEx( hTrayWnd,
0,
_T("TrayNotifyWnd"),
_T(""));
// Find the Button which is a child of ShellTrayWidnow.
HWND hButton = ::FindWindowEx( hTrayNotifyWnd,
0,
_T("Button"),
_T(""));
// Now get the DialogControlID of the button.
UINT DlgId = ::GetDlgCtrlID( hButton );
// Send a WM_COMMAND message, so the button reacts.
::SendMessage( hTrayNotifyWnd, WM_COMMAND, DlgId, 0 );
// Wait a bit to have an animation effect.
Sleep( 1000 );
// Send WM_COMMAND message once again.
::SendMessage( hTrayNotifyWnd, WM_COMMAND, DlgId, 0 );
![]()
Targeted Audiance – Intermediate
This entry was posted by Jijo Raj on April 9, 2008 at 4:05 pm, and is filed under Codeproject, MFC. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site.
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
Hi Pal,
You mean that – you would like to link to my site? With Pleasure.
For We.See.Tips,
Jijo.