Windows Mobile 6.5 Adding Shortcut to Start Screen and Running Single Instance of the application RRS feed

  • Question

  • Hi,

    Earlier on windows mobile 6.1 I had added Shell Notification in the App so that it used to remain in the shell and when double clicked I used to call ShowWindow(TRUE) API and if OK is clicked I used to hide it.

    But since shell Icons are not visible in 6.5 , I have added shortcut of it to Start Screen Area.
    But when I click on ShortCut it tries to launch new instance which is not desirable.

    Is there a design alternative in Windows Mobile 6.5 w.r.t Shell Notifications as in case of Win Mobile 6.1?

    Please assist in resolving this issue.

    Wednesday, October 28, 2009 1:31 PM

All replies

  • A better solution may be to used named events to detect whether or not a second instance of a program is being started. Named events can also be used to signal to the first instance that it should come into view.

    Rather than explan it I'll refer you to a MSDN video on it http://msdn.microsoft.com/en-us/netframework/bb943002.aspx
    Joel Ivory Johnson
    It takes all the running you can do to stay in one place.If you want to get somewhere else,you must try to run at least twice as fast as that.
    Wednesday, October 28, 2009 3:13 PM
  • Hi Joel,

    Thanks for the reply.

    You have given answer for avoiding new instance.
    I already used named Mutex and implemented in my app.

    The way my App worked in WM6.1 is -
    1. The instance registers itself for Shell Notification
    2. If user Clicks OK on the App I hide it using ShowWindow
    3. If user double clicks Shell Icon then I get notification from Shell and call ShowWindow(TRUE).

    Also for any new instance named Mutex is checked and new instance is killed if already named mutex is found.

    In this way single instance works perfect on WM6.1.

    But in case of WM6.5 there is an issue with Shell Notification.
    1. I dont know where WM6.5 Shell has gone
    2. Hence when I click OK and hide existing instance the application hides
    3. But since I dont see shell in WM6.5 I am not able to doble click on Shell Icon of my App and view it again

    I am looking for alternative in 6.5 where I can just hide application and view it again on some notification from Shell or any other place (for example Start Screen).

    Wednesday, October 28, 2009 3:39 PM