News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

QA: How can I insert an icon to the Pocket PC task bar?

By Vassili Philippov, November 06, 2002.
Print version

Question

I want my icon to appear on the task bar (the blue bar in the top of the screen). How can I do it?

Answer

First of all check that you really need it. "Designed for Windows for Pocket PC" logo requirements mention that you should not put anything on the taskbar:

Required: Applications May Not Use NavBar for Anything Application Specific
Other than the title, as required above, and the alert and notifications systems supplied through the API, the applications may not use the NavBar area for any additional functionality, such as for example subtitles of the current view, controls, tool bars, status icons, etc.

The best way of adding an icon to the taskbar in using Notification API. You can read about using it in the following article The New Notification API in Pocket PC 2002.

Nevertheless a lot of things cannot be done with Notification API. For example:
Different using of the Pocket PC taskbar

To insert your own window to the taskbar you have to find taskbar window and create your window with the taskbar window as a parent. Here is a sample code for that:

CString strClass = ::AfxRegisterWndClass(0); HWND hTaskBar = ::FindWindow(_T("HHTaskBar"), NULL); CWnd::CreateEx( 0, strClass, _T("MyIcon"), WS_CHILD|WS_VISIBLE, r.left, r.top, r.Width(), r.Height(), hTaskBar, 0, 0);

Note that the taskbar can be completely covered by programs like WisBar or Dashboard. So if you want to work in all possible situations you should first check if such programs are running and insert your icon into their window (which is a child window of the taskbar) instead of the taskbar window.

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House