Some notes on software development... RSS 2.0
# Wednesday, 18 February 2009

I had an issue with a compact framework project where I needed to add a shortcut on the desktop that pointed to my application whose location was \Program Files\MyApplication\.
You need to create a .lnk text file and place it on the device's desktop. However, .lnk files are a bit tricky to use with Visual Studio 2008 because it thinks it is an actual shortcut to a file on your actual desktop machine.

Mike Hall has a blog article that further covers Windows CE shortcuts.

Here are my steps on how to overcome the .lnk issue when using a Smart Device CAB project from within Visual Studio 2008.

My application is called MyApplication.exe and it's full path, once installed on Windows CE, is \Program Files\MyApplication\MyApplication.exe
All my application does is show 'Hello World' in a label on the form.
My Windows CE installer project is called MyWindowsCEInstaller.

First I create the application and installer projects and added the project output of MyApplication to the MyWindowsCEInstaller project. Here is what my solution looks like so far:


Next step is to create the shortcut file that will eventually be placed on the device desktop. To do this I created a new text file within the MyApplication project called MyApplication.lnkx
It's 'Build Action' property should be set to None and 'Copy to Output Directory' property set to Do Not Copy.
It is a lot easier to work with the file having the extension as .lnkx so that Windows doesn't think it is an actual shortcut file.

The MyApplication.lnkx file will contain the command line text and the command line character count separated by a hash (#).
So my Windows CE application full path is \Program Files\MyApplication\MyApplication.exe making the character count 48, below is my MyApplication.lnkx file:


Note:- If the path contains a space it must be enclosed in quotes and they get included in the command character count!!!

Next step is to add our MyApplication.lnkx file to the correct folder in the MyWindowsCEInstaller project.

From the root of the Primary Output File System view of the MyWindowsCEInstaller project add the Windows Special Folder.
Under the Windows folder create a new folder called Desktop

Add the MyApplication.lnkx file to the newly created Desktop folder.


Next, select the MyApplication.lnkx file from the MyWindowsCEInstaller project and change the TargetName to be MyApplication.lnk
This will change the extension off the shortcut file on the target device to be .lnk while on the development machine it will stay as .lnkx

The final files should look like this:

image image

Build the solution, copy the CAB file to the device, install it and now there should be desktop shortcut that points to the MyApplication application ;-)

image image

Note that the shortcut will also use the application icon as it's image once this has been set in the application properties, here it is the default image.

Mike Hall Windows CE Shortcuts Blog Article

Wednesday, 18 February 2009 17:31:35 (GMT Standard Time, UTC+00:00)  #    -
CF | CE Devices
# Thursday, 13 November 2008

To get ActiveSync working with an emulated device using Device Emulator you need to set ActiveSync to allow DMA connections:


Then when you select the Cradle option for your emulated device it will connect to ActiveSync too:


Thursday, 13 November 2008 15:00:07 (GMT Standard Time, UTC+00:00)  #    -
ActiveSync | CE Devices
# Thursday, 06 March 2008

Windows Mobile Developer Power Toys comes with a handy remote display application called ActiveSync Remote Display that allows you to control the device from your desktop. This is great for displaying running demos on real devices or capturing screen shots etc.

The steps to get it working for Windows CE are:

Download and install Windows Mobile Developer Power Toys

Connect the device via ActiveSync.

Start ActiveSync Remote Display from the desktop PC, somewhere in your start menu.

If you just get a blank white screen it means you are missing a file on the device.

ActiveSync Remote Display Blank Screen 

You need to copy the correct CPU version of cerdisp2.exe to the \Windows folder on the device.
For CE 4 and higher I use the version for my device (ARM CPU) located on my local machine here:

C:\Program Files\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\devices\wce400\armv4

Restarting ActiveSync Remote Display should now display the screen from the device with full mouse and keyboard support from your desktop.


One last may get a warning message about the OS or CPU every time you run ActiveSync Remote Display.
This is displayed because the application is older than the running CE version and is just a warning.


Thursday, 06 March 2008 10:04:06 (GMT Standard Time, UTC+00:00)  #    -
CE Devices
# Friday, 01 February 2008

If you are using Windows Zero Configuration (WZC) to configure your wireless networks and the device does not have any preferred networks configured you will get a pop-up configuration form every 60 seconds.
To stop this occurring you can un-check the 'Notify when new networks available' check-box on the config screen like so:

This is all fine for standard users but what if this happens when you have an application running in kiosk mode and under no circumstances should the user see any config screens? The user should not manually be 'checking' any boxes to enable/disable system settings as they are non-technical users.

Well, when you check the check-box described above it modifies a value in the registry.

The registry key is: HKLM\\Drivers\\BuiltIn\\Ethman\\Popup\\Popup
So setting this DWORD value to 1 turns pop-ups on and 0 turns pop-ups off.

During application deployment, however it may be done, this reg key can be set to ensure that the user never sees the WZC config form.

One thing to note is that different device manufacturer might set different default values.

At my company we use 2 different hardware devices: Datalogic Memor and Skeye Allegro.

For some reason the Skeye Allegro has a slightly different Key: HKLM\\Drivers\\BuiltIn\\Ethman\\Popup\\DoPopup
How's that for consistency?

One last thing, the key probably won't exist in any emulators as they don't emulate wifi ;-)

Friday, 01 February 2008 16:04:43 (GMT Standard Time, UTC+00:00)  #    -
CE Devices

Sign In
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2019
Hadrian Phillips

All Content © 2019, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)