Your best source of information and news about secrets, winvista and drivers on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

Windows Mobile

You are currently browsing the articles from MS Windows Vista Compatible Software matching the category Windows Mobile.

Using Custom Icons in Windows Mobile 6.5

Update: Added section on the special case of the ‘Games’ folder and how to setup PNG Start screen icons there.
Update: As of August 10, 2009, the requirement for the PNG Start Screen icons has changed from requiring three to one (90x90) PNG icon. This post has been updated to reflect this change. You can satisfy this requirement via the static setup described below.

If you’ve seen the any of the plethora of Windows Mobile 6.5 screen shots, likely you’d agree that it looks much better than previous versions. A component of this ‘face lift’, is support for PNG files in the Window Mobile 6.5 Start screen. Including a nicely rendered PNG file as your application icon is important to ensure the highest quality user experience across different devices.

If you plan to distribute your application via Windows Marketplace for Mobile (and I don’t know why you wouldn’t) the requirements document requires that you use a 90 x 90 Start screen icon for your application. This post will cover how to use PNG files as icons in the Windows Mobile 6.5 Professional Start screen. For information on creating PNG icons, see my previous post on Creating Custom Icons for Windows Mobile 6.5. The sample code I will be referring to in this post can be found here.

Contents:

Start Screen: Resolution / DPI and Icon Size
Registry Keys
Setup: Static or Dynamic
Cached Icons
Games Shortcuts Folder

Start Screen: Resolution / DPI and Icon Size

The Start Screen is one of the huge improvements in Windows Mobile 6.5 Professional. This replaces the Start Menu in previous versions. The improvements include: enhanced touch screen navigation (tap, tap and hold, pan, and flick) and more options for organizing and presenting Start menu items. image

If you are an experienced Windows Mobile developer, you know that depending on the DPI and resolution of the device, the shell extracts the appropriately sized icon from the EXE for display in the Start screen. Windows Mobile 6.5 still supports this; however now it also supports the display of PNG file icons. The shell does not automatically select the size of the PNG icon based on the device DPI. This dynamic selection of the icon is done in a setup dll. (See dynamic setup below.) However, if you do not want to provide a separate PNG file for each DPI, you can provide one (90x90) and the shell will scale down the icon as necessary, depending on the DPI of the device. (In fact, this is the Marketplace requirement.) The table below illustrates the DPI / resolution and icon size relationship. 

 

Windows Mobile Platform Resolution DPI Orientation Small Icon Large Icon Start Menu PNG Icon (6.5)
6.x Professional 240x240 96 Square 16x16 32x32 45x45
6.x Professional 240x320 96 Portrait & Landscape 16x16 32x32 45x45
6.x Professional 240x400 96 Portrait & Landscape 16x16 32x32 45x45
6.x Professional 320x320 128 Square 21x21 43x43 60x60
6.x Professional 480x480 192 Square 32x32 64x64 90x90
6.x Professional 480x640 192 Portrait & Landscape 32x32 64x64 90x90
6.x Professional 480x800 192 Portrait & Landscape 32x32 64x64 90x90
6.x Professional 480x864 192 Portrait & Landscape 32x32 64x64 90x90
6.x Standard 176x220 96 Portrait 16x16 32x32 N/A
6.x Standard 240x320 131 Portrait & Landscape 22x22 44x44 N/A
6.x Standard 240x240 131 Square 22x22 44x44 N/A
6.x Standard 240x400 131 Portrait & Landscape 22x22 44x44 N/A
6.x Standard 440x240 131 Landscape 22x22 44x44 N/A
 

Registry Keys

To have the Start screen use a PNG file instead of an icon embedded in the EXE, you need to provide the following registry entries:

[HKEY_LOCAL_MACHINE\Security\Shell\StartInfo\Start\Phone.lnk]
"Icon"="\Application Data\My App\newphoneicon.png"

Here are the definitions of the value pair settings:

Name Type Description
Name REG_SZ Specifies the display name of the item. If the value is not specified, the file name will be displayed without the extension.
Group REG_DWORD Specifies whether the item is a folder. The value can be set to TRUE or FALSE. Set the value to TRUE to indicate that the item is a folder. If the value is not specified, the system will determine the Group value by verifying whether the registry key has any subkeys.
Icon REG_SZ Specifies the path and file name where the icon is located. The icon can consist of a PNG file or an embedded icon resource module. If this value is not specified, the default icon of the shell will be used.
Rank REG_DWORD Specifies the rank of the item. An item that specifies a larger value for Rank will be displayed before items that specify a lower value. If this item is not specified, the Rank will be set to 0.
 
Security note: This requires creating a registry key underneath HKLM\Security. This is a protected registry location. To write to a protected registry key, the CAB file needs to be signed. This will not be a problem for Marketplace applications, since by definition they are signed. As mentioned, this article only applies to Windows Mobile Professional devices. However, if your use the same CAB for a Standard device installation, you will need to make sure your application is signed privileged, otherwise setup will fail.

Setup

In the next two sections, I’ll walk through two deployment scenarios, static and dynamic.

Static Setup:

You can specify the registry key as part of your CAB file configuration. Per the Marketplace requirements, I will use a 90 x 90 PNG file as the Start screen icon. In my Smart Device CAB project, I have added the following registry key:

image_thumb7

Note: This registry key supports ‘CE strings’ and .INF file strings. Above %InstallDir% maps to the ‘\Program Files\SMS Intercept’ directory.

My CAB file also includes the (90x90) AppIcon.png and a shortcut of the same name as the registry key above (SMS Intercept.lnk). See below:

image_thumb2

Dynamic Setup:

Detecting DPI:

Another way to configure the Start screen icon is dynamically: copying the appropriately sized PNG file based on the DPI of the device. We will use a setup dll to detect the DPI, and copy the appropriate PNG. You may know that WCELOAD (the EXE that process the CAB file) or a DLL that is loaded into its process, will return the same DPI (96) no matter the actual DPI of the device. To workaround this, we launch a very small helper EXE that quickly exits, without UI, and returns the DPI. The SDK sample ResDLL uses this technique as well as demonstrates how to install DPI specific resource DLLs. Here is the code used to detect the DPI:

int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HDC hdc = ::GetDC(NULL);
INT ans = ::GetDeviceCaps(hdc, LOGPIXELSX);
::ReleaseDC(NULL, hdc);
return ans;
}
Copy DPI specific files:

Our dynamic CAB file contains four png files:
        45.png
        60.png
        90.png
        AppIcon.png

Based on the DPI detected, we copy the appropriate PNG file to the filename AppIcon.png. AppIcon.png is included in the CAB as a fallback in case our DPI detect logic fails. The unused icons and the DPI detect EXE are deleted.

Here is a code snippet from the sample setup dll (SetupDPI) implementing this:

wsprintf(szFile,_T("%s\\%s"), pszInstallDir, _T("\\GetRealDPI.EXE"));
// Launch DPI Detector
::CreateProcess(szFile, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, &pi);
::WaitForSingleObject(pi.hProcess, 10000);
// DPI is returned in exit code of detector app
::GetExitCodeProcess(pi.hProcess, &nSystemDPI);
::CloseHandle(pi.hProcess);
::DeleteFile(szFile);

// Based on DPI, copy xx.png to AppIcon.png and delete unused files
wsprintf(szOutFile,_T("%s\\%s"), pszInstallDir, szTargetFilename);
for (INT i=0;i<ARRAYSIZE(DPI_Icon);i++) {
wsprintf(szFile,_T("%s\\%s"), pszInstallDir, DPI_Icon[i].lpstrIconSize);
if (DPI_Icon[i].DPI==nSystemDPI) {
::CopyFile(szFile, szOutFile, FALSE);
}
::DeleteFile(szFile);
}

Create Shortcut:

As mentioned, we do the post-processing of the files after the CAB is installed (in the Install_Exit function). That is, because the icon image in the Start screen is created when the shortcut is created (see the cached icons section below), we need to create the shortcut in the setup dll instead of in the CAB file as was done in the static CAB sample. Otherwise, the Start screen will use an icon extracted from the EXE instead of the PNG file. Here is the language independent code that creates the shortcut:

// Build lnk filename
PTCHAR pAppDir = wcsrchr(pszInstallDir, '\\');
TCHAR szShortcutPath[MAX_PATH];
// CSIDL_PROGRAMS == \Windows\Start Menu\Programs
SHGetSpecialFolderPath(hwndParent, szShortcutPath, CSIDL_PROGRAMS , false);
wsprintf(szFile,_T("%s%s%s"), szShortcutPath, pAppDir, _T(".lnk"));

// Build exe filename
// CSIDL_PROGRAM_FILES == \Program Files
SHGetSpecialFolderPath(hwndParent, szShortcutPath, CSIDL_PROGRAM_FILES , false);
wsprintf(szOutFile,_T("\"%s%s%s%s\""),
     szShortcutPath, pAppDir, pAppDir, _T(".exe"));

SHCreateShortcut(szFile, szOutFile);
 
Note that the dynamic CAB sample does not not contain the file system declaration that creates a shortcut as the static sample CAB does.

Cached Icons

During development, you will likely want to change the PNG file as you experiment will different artwork. You will notice that if you overwrite the PNG file, the Start screen will not use the new image. This is because when the Start screen shortcut is created, the icon image is cached by the shell. Thereafter for better performance, the shell retrieves the image from the cache. The cache is rebuilt a boot time. Here is one possible workaround:

  1. Delete the shortcut
  2. Rename (or copy) target EXE name. For example, rename hello.exe to hello1.exe
  3. Recreate shortcut pointing to new EXE name.

Here is provisioning XML that does this. You can run this using RapiConfig.exe:

<wap-provisioningdoc>
<characteristic type="FileOperation">
<!-- Delete Shortcut -->
<characteristic type="%CE11%\SMS Intercept.lnk" translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>

<!-- Copy EXE name to new EXE -->
<characteristic type="%CE1%\sms Intercept\sms Intercept1.exe"
          translation="install">
<characteristic type="Copy">
<parm name="Source" value="%CE1%\sms Intercept\sms Intercept.exe"
          translation="install"/>
</characteristic>
</characteristic>

<!-- Create new shortcut pointing to new EXE name -->
<characteristic type="%CE11%" translation="install">
<characteristic type="MakeDir" />
<characteristic type="SMS Intercept.lnk" translation="install">
<characteristic type="Shortcut">
<parm name="Source" value="%CE1%\sms Intercept\sms Intercept1.exe"
translation="install" />
</characteristic>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

Games Shortcuts Folder

If we were installing this application into the Games folder, the key pointing to the PNG file would look like this:
[HKEY_LOCAL_MACHINE\Security\Shell\StartInfo\Start\Games\Phone.lnk]
"Icon"="\Application Data\My App\newphoneicon.png"

Game developers have raised the question, “How do I create the Games registry key in a language independent way?” Without the Games folder, this key is language independent. However, the shell will look for the shortcut (.lnk) files in the directories below Start, therefore we need to setup this key using the localized name for Games. This requires a Setup DLL. See the sample code for this post here.

To have your shortcut created in the Games folder, you must change the following line in the SetupDPI.CPP and rebuild the project:

// Set this to true to create shortcut and 
// registry key in the localized 'Games' Folder
BOOL g_bCreateInGamesFolder=FALSE;

Conclusion

You should now understand how to configure your CAB file projects to include PNG files as icons in the Windows Mobile 6.5 Start screen.

For a list of frequently asked questions on this topic see here: Start Screen PNG Icon FAQ

Written by Mike Francis on August 11th, 2009 with no comments.
Read more articles on graphics and setup and otherSoftware and Icons and Windows Mobile.

Get Ready; Windows Marketplace for Mobile Offers Millions of Potential New Customers

My name is Todd Brix and I am the Senior Director for Mobile Platform Services Product Management at Microsoft. I am on site at Microsoft’s Worldwide Partner Conference in New Orleans to talk about Windows Marketplace for Mobile and the terrific opportunity it represents for developers and partners. Given the enthusiasm we’ve seen around Windows Marketplace since we announced it earlier this year, I'm excited to have this opportunity to provide an update and hopefully address some of the feedback we've received.In terms of milestones, I'm pleased to report that Windows Marketplace is on schedule to open for submissions in 29 supported countries* on July 27th. We're already working with a wide range of leading developers for both business and consumer applications and will soon be able to make available a new wave of applications that will be ready for download when Windows Marketplace launches with Windows Mobile 6.5 in the fall. To make things a little more interesting, later this month we'll also be announcing the details of a developer contest that will kick off at launch.

We're working hard to create a new experience for mobile users and developers alike; where users can easily discover and confidently purchase and download applications for work, life or play and developers feel good about the submission process and are able to reach a new market for their mobile applications. In fact, we’re announcing today that by the end of 2009 Windows Marketplace will also be available to Windows Mobile 6.0 and 6.1 devices. This means that developers will have an opportunity to reach more than 30 million Windows Mobile devices. To help those millions of business users find what they're looking for, we’re also unveiling the Windows Marketplace Business Center; a category in Windows Marketplace that will contain mobile business applications across several common industries and line of business functions from leading companies that include Avanade UK, Formotus, Ilium Software, Pyxis Mobile and WebIS. Business Center is another way for our partners to differentiate themselves and showcase their business applications, while making it easier for users to locate and purchase the latest mobile business tools.


(sample view of Windows Marketplace Business Center, subject to change.)

To recap the Windows Marketplace for Mobile announcements at Worldwide Partner Conference:

Application Submission Opens on July 27th: Windows Marketplace will open for application submissions from 29 supported countries July 27.

Windows Mobile 6.0 and 6.1 Support: Windows Marketplace will be available for Windows Mobile 6.0 and 6.1 by the end of 2009 (in addition to Windows Mobile 6.5 at launch in the fall).

Business Center: Windows Marketplace will feature a "Business Center" category for business applications.

Developer Contest: Microsoft will be disclosing the details of a Windows Marketplace developer contest on July 27.

I’ll be on site at the Worldwide Partner Conference today talking to partners and presenting our Windows Marketplace strategy and even offering a brief demonstration on the main stage on Wednesday morning. Throughout the event, I’ll be gathering feedback and doing my best to drive registration and application submissions for July 27th. My team and I are eager to get your feedback and will do our best to address your comments and questions in the days and weeks ahead.

You can also view my video post here on Channel 9.

Australia, Austria, Belgium, Brazil, Canada, Denmark, Finland, France, Germany, Greece, Hong Kong SAR, India, Ireland, Italy, Japan, Luxembourg, Mexico, New Zealand, Netherlands, Norway, Poland, Portugal, Singapore, Spain, Sweden, Switzerland, Taiwan, United Kingdom, and the United States.

Written by Todd Brix on July 14th, 2009 with no comments.
Read more articles on Announcements and Windows Marketplace and otherSoftware and blog and Windows Mobile.

Windows Mobile MSDN Blog Archives

As of today the Windows Mobile Blog has officially joined The Windows Blog. Not only have our bloggers made the transition, but much of the high impact content has been brought forward for your convenience.

SDK, DTK, DRK: WTF?! | MSDN

Windows Mobile RampUp Track Is Now Available On MSDN | MSDN

Carry Your Office in Your Pocket #1 | MSDN

Twisted Pixels #4 – A Button-Mashers Guide To Input | MSDN

Windows Mobile Facebook Application Update | MSDN

Just Say No To GAPI – What You Need To Know About AllKeys And Input Management | MSDN

Microsoft Tag Update | MSDN

Resolving Common Crashes Seen in Windows Mobile Watson Data | MSDN

Twisted Pixels #3 – Memory Mysteries | MSDN

Samsung’s Web Site for Windows Mobile Developers | MSDN

Twisted Pixels #2 – Doing Graphics! | MSDN

Twisted Pixels #1 – A Mobile Game Development Diary | MSDN

developer.windowsmobile.com | MSDN

Windows® Marketplace for Mobile Developer Strategy Announced! | MSDN

DreamSpark for Students | MSDN

Introducing Windows® Marketplace for Mobile… | MSDN

Microsoft My Phone | MSDN

Mobile Manager for Netflix | MSDN

Microsoft Tag | MSDN

Developing Location Aware Applications for Windows Mobile | MSDN

New Version of Live Search Mobile | MSDN

Survey of Web Browsers for Windows Mobile | MSDN

Windows Mobile Development Forum | MSDN

Press, Click, Select, or Choose?!? | MSDN

Written by Eric Nelson on July 14th, 2009 with no comments.
Read more articles on Windows Marketplace and otherSoftware and Windows Mobile.

State of the Blog – A Little Update on Where We Are Today

We are in an exciting time for Windows. We’re about to launch our best version of Windows yet – Windows 7. In between all the Windows 7 awesomeness, I wanted to take a moment to talk about The Windows Blog and where we are today with the site.

We’ve come a long way since 2006 when we launched as the Windows Vista Team Blog. This last fall we re-launched the site as The Windows Blog. When we re-launched, the focus of the site was to be the ultimate resource for Windows through the use of blogging – and to grow.

In the site’s design, we put an emphasis of multiple blogs existing under The Windows Blog “umbrella” that would cater to different audiences. Our original blog, Windows Vista Team Blog, became one of several blogs under that “umbrella” and we also launched the Windows 7 Team Blog which is where you will find all the latest Windows 7 news and announcements. Also in the fall, we launched the Windows Security Blog featuring blog posts focusing on Windows security from Paul Cooke. Paul blogged live from RSA earlier this year.

And in the last few months, we’ve grown quite a bit to cover a broader array of audiences with several other new blogs joining our site:

Windows for your Business Blog: Launched in February by Gavriella Schuster, this blog focuses on our commercial customers for Windows. Most recently, Rich Reynolds who is a GM on the Windows Commercial Marketing Team posted a blog about how our business customers provided early feedback for Windows 7.

Windows 7 for Developers Blog: At the end of March, we launched the Windows 7 for Developers. This blog is run by Yochay Kiriaty from the Developer and Platform Evangelism (DPE) Team here at Microsoft. Yochay blogs about all the really cool things developers can do with their applications to take advantage of Windows 7 features like the new Windows Taskbar. If you’re a developer – this blog is a must read.

Springboard Series Blog: This blog launched in early June and is run by Senior Community Manager Stephen Rose. The Springboard Series is a TechNet portal and is the ultimate Windows resource for IT Professionals. The Springboard Series Blog focuses on calling out those resources for IT Pros. Just recently, a Virtual Roundtable (VRT) discussion was help with Mark Russinovich on Application Compatibility – check it out here!

Soon, my friends over on Windows Mobile will be blogging on The Windows Blog too! Their blog can be found here.

And of course I continue to focus on my Windows experiences on the Windows Experience Blog as well.

What’s great about growing the blogs under The Windows Blog “umbrella” is that we have blog posts talking about a variety of Windows topics relevant to a broad set of audiences.

However what if some of the content being blogged about isn’t relevant to me?

All blog posts from all blogs automatically appear in our main RSS feed. Some people want to see and read everything. This is likely how they are doing so or going to our frontpage. But if you only care about content from a specific blog, you can subscribe to the individual RSS feed for that blog. Here are the RSS feeds for each of the blogs here on The Windows Blog:

Tags we use for blog posts also have their own RSS feeds. If all you care about is our announcements, you can subscribe to the RSS feed for the Announcements tag.

If RSS isn’t your thing, you can also follow The Windows Blog on Twitter and get all our latest blog posts too.

So what’s coming up for The Windows Blog? Well – lots more awesome Windows 7 blog posts of course. We’re also going to be introducing a new menu system in the coming weeks and introducing more new blogs – including some localized blogs in a variety of different languages.

I’m very proud of the community of Windows blogs we’ve built up here on The Windows Blog. Thank you to the millions of visitors who read our posts each month and continue to be excited for Windows!

Digg This

Written by Brandon LeBlanc on July 9th, 2009 with no comments.
Read more articles on Twitter and otherSoftware and The Windows Blog and Social Media and Resource and State of the Blog and windows 7 and blog and Windows Mobile and RSS and Blogging and Community and RSS feeds and Windows.

Windows Mobile Blog: Coming Soon!

<html>Hello World</html>

We’re moving our blog here to join our friends in Windows.

See you in July!

Written by Eric Nelson on June 11th, 2009 with no comments.
Read more articles on Windows phone and otherSoftware and blog and Windows Mobile.

New Version of Windows Live for Windows Mobile Available

Today the Windows Live for Windows Mobile Team posted that new bits are now available for everyone to download for their Windows Mobile phones.

Wait no more! The latest bits for Windows Live Client for your Windows Mobile are available for download. To get yours now, point your mobile browser to http://wl.windowsmobile.com

If you have Windows Live already installed on your device, you will need to uninstall it first. To do that, go to Settings->Remove Programs, select Windows Live entry from the list (if any) and click Remove. If you don’t find Windows Live on the list, then you are good to go.

With Windows Live client you will be able to:

  • Synchronize Live contacts with your contacts on the device
  • Synchronize your Live email (msn, hotmail, live)
  • View graphics, web links and contact photos in emails
  • Respond to emails with voice recordings
  • Upload photos to your Windows Live Spaces

Go ahead, give it a try and let us know what you think!

As soon as I heard, I installed it quickly on my Samsung Blackjack 2. I simply cannot live without Windows Live for Windows Mobile on my phone. Windows Live for Windows Mobile allows me to sync (and when I say "sync" I really do mean *sync*) my Windows Live Hotmail mailbox to my phone as well as all my Windows Live Contacts. I can read a message on my desktop PC at home using Windows Live Mail and that same exact message I just read syncs to Windows Live Hotmail and then to my phone using Windows Live for Windows Mobile - including the fact it is now marked read as I had read it on my PC. I have the same email experience (emails read or unread, emails filtered into certain folders, etc) across multiple PCs using Windows Live Mail, on my phone with Windows Live for Windows Mobile, and on the web with Windows Live Hotmail.

I previously blogged about Windows Live for Windows Mobile (in a little bit more detail) a few weeks ago when the first set of bits went live.  

ALSO: if you're interested, try out the Beta of the new Windows Live Mobile Homepage at mhome.live.com on your mobile device!  I've got this page set up as my Home Page in Internet Explorer on my Blackjack 2.

Written by Brandon LeBlanc on July 23rd, 2008 with no comments.
Read more articles on Samsung BlackJack II and Windows Live for Windows Mobile and otherSoftware and Windows Mobile and Windows Live and Featured News.

« Older articles

No newer articles