Problems with Shell command.

Discussion in 'Questions (Windows Mobile)' started by RCC2k7, Mar 27, 2009.

  1. RCC2k7

    RCC2k7 Member Licensed User


    I've been trying to create a simple mobile application that does the equivalent of the Run dialog you get on the PC when you press WindowsKey+R. The idea is to launch this dialog from a hardware button on a PPC or speed dial entry on a Smartphone.


    But I'm having some issues.

    1. I can only launch actual programs, not associated documents, let alone URL's. :(

    2. If I type bogus stuff, my error handler is totally ignored on the Device. On the Desktop, I do get the appropriate error message.

    Are these fixable? (Attached is my source code.)
    Last edited: Mar 27, 2009
  2. Erel

    Erel Administrator Staff Member Licensed User

    I've modified your program to first check if the file exists and then if the file's extension is not ".exe", it will find the right launching application from the registry.
    The actual file will be passed as a parameter.

    Attached Files:

  3. RCC2k7

    RCC2k7 Member Licensed User

    Thanks Erel. I appreciate you taking the time to look at my code. For program design reasons, I still had to alter your code, since it wasn't allowing for direct execution of built-in Windows programs, such as entering just "notepad" instead of requiring "C:\Windows\Notepad.exe" or entering just "notes" instead of requiring "\Windows\Notes.exe".

    Still, not only you gave me the code I needed to launch associated documents, but you also gave me some pointers on how to parse the input, so I think I can now get the code to process URL's too.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice