locked
Programmaticaly Launching PIE and then Returning Somehow RRS feed

  • Question

  • Hello all,

    I have an application which launches PIE using the following approach:

    System.Diagnostics.Process.Start(url, null);

    This works fine and PIE launches and loads url. Unfortunately I have don't have a good way of getting back to my application which launched PIE in the first place. Is there a good 'Programmatic' Solution to this problem -- perhaps implementing some kind of softkey to bounce back to the application which initially spawned PIE?

    • Edited by valkyrie001 Tuesday, July 28, 2009 11:24 PM
    Tuesday, July 28, 2009 9:42 PM

Answers

All replies

  • Hi,

    You might be able to start PIE on a different thread, you could kick the PIE starting thread off from your main thread, when this has finished then your main thread will still be running which you could then show your application again.

    Hope this helps.

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Wednesday, July 29, 2009 6:16 AM
  • Hello Paul,

    could you perhaps give a code snippet (C#) showing how to spawn pie in a thread? With this approach the one thing which I dislike is that everytime PIE is to be launched from my application it means that a thread will have to be spawned and a new instance of PIE will be created. It would be nice if PIE was minimized and not destroyed each time. I was thinking about possibly having a global hotkey setup which would allow flipping back to my application. Any suggestions as to whether this approach is a good idea as well as how to do it?
    Wednesday, July 29, 2009 12:48 PM
  • Another possibility I was thinking about was writing an extension to PIE to present a menu item causing the browser to minimize and causing my application to be re-invoked. However, I don't know if this is possible. Any suggestions from anyone?


    Regards
    Thursday, July 30, 2009 2:51 PM
  • Hi,

     

     

    I am not sure what exactly you wanna achieve.

    If you want to open a PIE while keeping your form application in the front at the same time. The following code can achieve that.

     

     

    private void button1_Click(object sender, EventArgs e)

    {

    System.Diagnostics.Process.Start("\\windows\\iexplore.exe", "www.google.com");

    this.Show();

    }


     

    If there is further issues, let me know.

     

    Regards,

    Jennifer

     

     

     

    Friday, July 31, 2009 9:49 AM
  • Hi Jennifer,

    what I want to achieve is as follows:

    1) From my form based application clicking a button should launch PIE and PIE should be the visible window.
    2) Somehow from PIE possibly by clicking on a customized menu item or something, I want to be able to return to my form based application.

    I can already do #1 what I want to to do is #2 -- specifically "clicking on a customized menu item or something" to return to my form based application. I hope this makes things more clear.

    Thanks
    Sunday, August 2, 2009 6:31 PM
  • Hi valkyrie,


    I got you!
    For your #2, I think one possible solution is to use hook. Write a dll and hook to PIE process, upon catching specified event (up to your design)happened in PIE the hook sends some message back to your application (sendmessage()),   the message handler in your application set form visible.

    For the detail of hook, please refer to

    http://social.msdn.microsoft.com/Forums/en-US/netfxcompact/thread/676a597a-7257-4fcc-ad31-1ec1bce8ba6a

    How this sounds to you, let me know if you got better ones.

     

    Cheers,

    Jennifer

    Monday, August 3, 2009 1:20 AM
  • Hi JenniFer,

    thanks for the interesting solution -- I like it. I will give it a try and will let you know how it works out.


    Thanks
    Tuesday, August 4, 2009 1:37 AM