two-state icons on Windows Mobile 5.0 start menu (grid view)

Some shortcuts on the start menu of a Windows Mobile 5.0 Smartphone show a different icon when they're selected. The Messaging icon shows the slip of paper poking out of the envelope, for example.

Has anyone managed to recreate this with their own applications, and if so, how

Is there a convention for how the icons have to be ordered in the .rc file or is there a naming convention

Is there a URL talking about this in MSDN

Thanks in advance,

Matt



Answer this question

two-state icons on Windows Mobile 5.0 start menu (grid view)

  • ggvw

    can u please give some example how to edit the .lnk file , it will e very useful to me.

    thanks


  • Andi_DE

    this is what MSDN has to say on the subject (not sure why the format is all weird; sorry):

    ...

    A .lnk file is a text file that contains the command line for the linked target, which can be enclosed in double quotation marks, along with the length of that command line.

    You can also choose to pass parameters into the linked target. However, this is behavior that can be changed if the shortcut module is replaced in Coredll.dll.

    By default, an .lnk file uses the following format.

    [number of ASCII characters after pound sign allocated to command-line arguments]#[command line] [optional parameters]

    For example, to start MyApp.exe and pass two optional parameters into the application, a sample MyApp.lnk file contains the following syntax.


    40#\Windows\MyApp.exe parameter1 parameter2


  • Steve Westlake

    where is this .lnk file resides in the device
  • ekolis

    Can u please tell me that before this step which step i have to follow

    vishal


  • MFaulk

    hi,

    I have been wondering what kind of control is the start menu of wm 5.0 smartphone, is it a ListView control with LVS_ICON style the different i noticed are when the item is selected/focused the icon will be changed and the focus rectangle will be on the icon only not the text itself. Anyone know how to accomplish above 2 effects any good guides or info are welcome and appreciated.

    thanks in advance


  • zbee

    Kieren wrote:
    I came across a similar solution to the one from Eddy above, which was actually backwards compatible with older (2002, 2003 and 2003SE) devices, using the following syntax in the icon file:
    <ignored>#<target app> <full path of icon or DLL file containing icon>,<index of icon>
    or
    <ignored>#<target app> <full path of icon or DLL file containing icon>,-<resource ID of icon>

    Sorry to be hijacking the (year-old) thread, but is this the canonical format for a shortcut file If not, can someone point me at a spec for them

    Cheers,


    Chris.

  • Dc123

    Thanks for the reply Matt.

    That page is sort of a great example of why I asked the question - it doesn't mention the " <full path of icon or DLL file containing icon>,<index of icon>" bit at all, so does that mean it's an undocumented feature, or is that MSDN page (google gave me http://msdn2.microsoft.com/en-us/library/ms861519.aspx based on your quote) just incomplete



  • FrannieG

    hi

    i have edited the registry values as given but seen no effect on the icon

    are there any pervious steps to be followed before changing registry

    please do reply

    thanks

    vishal


  • ChaosGeorge

    You can now register "selected" icons for a file class just like you register default icons:

    HKEY_CLASSSES_ROOT\classname
       \DefaultIcon = <module>,-<icon ID>
       \SelectIcon = <module>,-<icon ID>

    Then, there is the preexisting way to map an extension into a class, so that all files with that extension get those default icons and other class properties automatically:

    HKEY_CLASSES_ROOT\.file-extension
       \(Default) = classname

    And starting with WM 5.0 you can also override the icon associated with a link (which is what ends up in the start menu folder) with a class (before you could only override it with a single icon), using the following syntax in the icon file:

    <ignored>#<target app> :
    classname


    Applications can retrieve the selected icon corresponding to any file by passing the new flag SHGFI_SELECTICON to SHGetFileInfo. This is how the start menu works.

    This information should be part of the SDK soon.

    Hope this helps
    Eddy


  • nothinghotmailcom

    and just to add more info, this is how MSDN describes the feature (but notice the tantalising letter 'I' starting an unfinished new sentence at the end. Who knows what was about to be revealed ):

    Start menu grid view (SP Only) Users can access programs on the Windows Mobile-based Smartphone through a grid user interface. When moving focus from one icon to another, the icon gaining focus will be able to show a new icon and the icon losing focus will revert to its default icon. I

    source: http://msdn.microsoft.com/library/default.asp url=/library/en-us/mobilesdk5/html/wce51conUserInterfaceProductReference.asp

  • Golem

    If you want elements of file class "foo" to have different default and selection icons, your registry changes should be done to the reg key:

    HKEY_CLASSES_ROOT\foo

    Then, the .lnk file that you install in the start menu folder to represent the "foo.exe" application would contain the following

    #foo.exe :foo

    Does this make sense

    Thanks,

    Eddy



  • firec

    I'm seeing an issue on cingular 2125 where icons get messed up. Even a reboot does not clear issue. To be clear the wrong icon is shown for a particular app.. i.e internet explorer icon shows up as folder icon. Do you know how to clear this issue
  • UmerKhan

    did you edit the text in your start menu shortcut file (.lnk) in the manner outlined above:

    <ignored>#<target app> :classname

    the "classname" should be the same as the class name you used in your registry modifications.

    Eddy



  • Jay T

    Hi,

    I've also been looking at a similar problem for a while, that of specifying an icon for an application which is different from/not part of the executable itself (for large executables, the time the device needs to locate and display the icon can mount up into the 10s of seconds, particularly for files on flash or card).

    I came across a similar solution to the one from Eddy above, which was actually backwards compatible with older (2002, 2003 and 2003SE) devices, using the following syntax in the icon file:
    <ignored>#<target app> <full path of icon or DLL file containing icon>,<index of icon>
    or
    <ignored>#<target app> <full path of icon or DLL file containing icon>,-<resource ID of icon>

    Doing this manually is trivial, but I've not been able to find an automatic way of creating shortcuts like this via the .inf file definitions (necessary if you support the %CEn% macros within your shortcut creation or file installation).

    I'm fairly certain that it may be possible to fudge this by executing some code in the setup DLL during INSTALL_EXIT to "edit" the shortcut file, but this feels a little inelegant and potentially risky.

    Has anyone come across a way to specify this extra part of the shortcut within the .inf file

    Kieren

  • two-state icons on Windows Mobile 5.0 start menu (grid view)