Skip to main content

Shortcut icon to my phoneME application

3 replies [Last post]
rgw21
Offline
Joined: 2010-07-25
Points: 0

Hi guys,
I have created an application using phoneME (Runs on WinCE & WinMobile 5 & 6) , and I want to assign a customized image icon to the shortcut that runs the application, but couldn't find a way to achieve this, does anyone know a way to do that?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hinkmond Wong Guest
Offline
Joined: 2010-11-03
Points: 0

On 11/15/2010 4:01 AM, forums@java.net wrote:
> Hi guys,
>
> I have created an application using phoneME (Runs on WinCE & WinMobile
> 5 & 6)
> , and I want to assign a customized image icon to the shortcut that
> runs the
> application, but couldn't find a way to achieve this, does anyone know
> a way
> to do that?

Hi rgw21,

Your question is not a phoneME Advanced question. Instead, your
question involves how to use the CAB Wizard for creating an installation
bundle on Windows Mobile (which allows you to set the icon for a shortcut).

See:
http://www.mobilepractices.com/2008/02/how-to-create-windows-mobile-smar...

This is out of scope of this forum, but in general, you need to follow
the above set of instructions to generate a CAB file with your shortcut
as the "Application" and change the Application, Properties, Resources
icon setting to the image file that you want as your icon after it is
installed on Windows Mobile.

If you have any further questions, you should check with a Windows
Mobile forum instead of this one, though.

Hope this helps!

Thanks,
Hinkmond

davyp
Offline
Joined: 2007-01-03
Points: 0

Hi,

While I agree with Hinkmond's assessment that this is not the best place to ask this question, let me
say that there is a way to create a shortcut with an icon not involving generating a new cab.

First of all you need to know that the icon of a shortcut is defined by the executable it refers to.
For my Windows Mobile port, I have to specify a rc resource configuration file in which I refer
to a 32x32 (or 64x64) .ico file, i.e. a windows icon file. At compile time, this resource configuration
file is processed, the .ico translated into binary resource format that gets linked into the final binary
(i.e. the cvm.exe file). So the icon gets defined by the binary. I am not sure that the CAB approach
suggested by Hinkmond will work, but you might try to strip out the icon in cvm.exe and replace it
with another one with specialized tools.

However, there is a not so straightforward approach to get custom icons. I'll give you the steps
involved.

(1) create a C++ file with a DllMain entry, serving as a dummy empty library
(2) create the .ico file (32x32) bits
(3) create a .rc resource configuration file
(4) Use the resource compiler to process the configuration file
(5) cross-compile the C++ for ARM into a DLL library in which you link in the output of the resource
compiler.
(6) create a custom lnk file

A normal lnk file looks like this:

#254"\cdc\bin\cvm,exe" -jar "\temp\app.jar"

The one with a custom looks like this

#254"\cdc\bin\cvm,exe" -jar "\temp\app.jar"?\temp\icons.dll,-1001

The icons.dll is the file you built in step (5)
The 1001 is the numeric identifier of the icon in the resource configuration file you built in step (3)

As you can see, it is not that easy. Windows Mobile does not offer a way to refer to e.g. png
files in the shortcut file. Every icon has to be embedded in an exe or dll file.

Cheers,
Davy

rgw21
Offline
Joined: 2010-07-25
Points: 0

Thanks guys, I will check it..