Click here to get back home

Icon in title bar

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Icon in title bar Daniel Seifert 09-11-2007
---> Re: Icon in title bar Peter Foot [MVP...09-11-2007
Posted by Daniel Seifert on September 11, 2007, 4:46 am
Please log in for more thread options
Hi,

I want to put an icon in the title bar, but I can't find the command to do
it. I know it is possible as e.g. Outlook and Skype do it when there is a
new email/message/etc. Can anybody point me in the right direction, please?

Thanks,

Daniel


Posted by Peter Foot [MVP] on September 11, 2007, 6:08 am
Please log in for more thread options
SHNotificationAdd or managed Microsoft.WindowsCE.Forms.Notification class
can be used for icon only or popup dialog notifications

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

> Hi,
>
> I want to put an icon in the title bar, but I can't find the command to do
> it. I know it is possible as e.g. Outlook and Skype do it when there is a
> new email/message/etc. Can anybody point me in the right direction,
> please?
>
> Thanks,
>
> Daniel
>


Posted by Daniel Seifert on September 11, 2007, 8:18 am
Please log in for more thread options
Peter Foot [MVP] wrote:
> SHNotificationAdd or managed Microsoft.WindowsCE.Forms.Notification class
> can be used for icon only or popup dialog notifications

I always thought SHNotificationAdd was not supported on smartphone and I've
never seen the SHNotificationAdd popup dialog notification ("bubble") on
smartphone. The icon presentation does look the same though, but on the
other hand I tried to use SHNotificationAdd both using the sample from
http://msdn2.microsoft.com/en-us/library/aa455967.aspx as well as my own
code (from my ppc code) and it only returned an error
(ERROR_INVALID_PARAMETER)

SHNOTIFICATIONDATA sn = ;

sn.cbStruct = sizeof(sn);
sn.dwID = type;
sn.npPriority = SHNP_INFORM;
sn.csDuration = 0xFFFF;
sn.hicon = LoadIcon(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDI_MAINICON));

CString leftSoftkeyText, rightSoftkeyText;
// load strings

sn.clsid = CLSID_MYAPP_NOTIFY;

sn.rgskn[0].pszTitle = leftSoftkeyText;
sn.rgskn[0].skc.wpCmd = ID_NOTIFY_FOREGROUND;
sn.rgskn[0].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_DISMISS;

sn.rgskn[1].pszTitle = rightSoftkeyText;
sn.rgskn[1].skc.wpCmd = 0;
sn.rgskn[1].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_HIDE;

sn.grfFlags = 0;
sn.hwndSink = m_hWnd;
sn.pszTitle = L"Title";
sn.pszHTML = ConstructNotificationMessage();

SHNotificationAdd(&sn);

Daniel



Posted by Peter Foot [MVP] on September 11, 2007, 10:13 am
Please log in for more thread options
To clarify, on Smartphone only Icon notifications are supported, on Pocket
PC you can do both icon and popup notifications.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility

> Peter Foot [MVP] wrote:
>> SHNotificationAdd or managed Microsoft.WindowsCE.Forms.Notification class
>> can be used for icon only or popup dialog notifications
>
> I always thought SHNotificationAdd was not supported on smartphone and
> I've
> never seen the SHNotificationAdd popup dialog notification ("bubble") on
> smartphone. The icon presentation does look the same though, but on the
> other hand I tried to use SHNotificationAdd both using the sample from
> code (from my ppc code) and it only returned an error
> (ERROR_INVALID_PARAMETER)
>
> SHNOTIFICATIONDATA sn = ;
>
> sn.cbStruct = sizeof(sn);
> sn.dwID = type;
> sn.npPriority = SHNP_INFORM;
> sn.csDuration = 0xFFFF;
> sn.hicon = LoadIcon(AfxGetResourceHandle(),
> MAKEINTRESOURCE(IDI_MAINICON));
>
> CString leftSoftkeyText, rightSoftkeyText;
> // load strings
>
> sn.clsid = CLSID_MYAPP_NOTIFY;
>
> sn.rgskn[0].pszTitle = leftSoftkeyText;
> sn.rgskn[0].skc.wpCmd = ID_NOTIFY_FOREGROUND;
> sn.rgskn[0].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_DISMISS;
>
> sn.rgskn[1].pszTitle = rightSoftkeyText;
> sn.rgskn[1].skc.wpCmd = 0;
> sn.rgskn[1].skc.grfFlags = NOTIF_SOFTKEY_FLAGS_HIDE;
>
> sn.grfFlags = 0;
> sn.hwndSink = m_hWnd;
> sn.pszTitle = L"Title";
> sn.pszHTML = ConstructNotificationMessage();
>
> SHNotificationAdd(&sn);
>
> Daniel
>
>


Posted by Daniel Seifert on September 11, 2007, 10:48 am
Please log in for more thread options
Peter Foot [MVP] wrote:
> To clarify, on Smartphone only Icon notifications are supported, on Pocket
> PC you can do both icon and popup notifications.

Alright, I could live with that. However, do you happen to have sample code
tested on smartphone or maybe see an error in my code (see my previous
post)? Because I can't get the icon to be displayed.

Daniel


Similar ThreadsPosted
How to islate my title bar from system icon bar? March 31, 2008, 4:09 am
Icon shortcut and appname: how do you overly title of app over ic August 16, 2005, 5:59 pm
PIE does not display page Title in title-bar, why? July 1, 2006, 9:48 pm
Start Icon - change icon image when they have focus? April 4, 2006, 12:01 pm
WM5 - Title bar Icons December 23, 2005, 8:20 am
How to replace the title bar area with my own picture? September 26, 2005, 12:03 pm
How to show envelope on title bar Smartphone2002 + March 27, 2007, 3:56 am
Icon on the homescreen May 31, 2005, 3:57 pm
App icon specification June 7, 2006, 5:17 pm
How do you use the small icon? August 9, 2006, 10:01 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap