locked
How to close other programs. RRS feed

  • Question

  • Hi all,

    I would like to know if there's a way to close another running programs when i start my application. I want to make sure only my application is running at the device.
    Example: I start running my program.. at the begging i verify if theres another application running, like word or the camera, then i close this program.


    Thx,
    Friday, October 16, 2009 12:34 PM

Answers

  • hi Renan,


         you need to find the procces id of the applications to be closed and use openprocess() api which returns the handle of the process and this handle can be used in terminateprocess() api which destroys the process...hope this hint can solve your problem....


    if u find my answer helped u please do mark it as helpful.


    Regards
    Avinash
    Whenever I find the key to success, someone changes the lock.
    Friday, October 16, 2009 4:01 PM
  • Hi,

    You may find the following MSDN page useful (Creating a Microsoft .NET Compact Framework-based Process Manager Application) :-

    http://msdn.microsoft.com/en-us/library/aa446560.aspx

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Friday, October 16, 2009 4:06 PM

All replies

  • hi Renan,


         you need to find the procces id of the applications to be closed and use openprocess() api which returns the handle of the process and this handle can be used in terminateprocess() api which destroys the process...hope this hint can solve your problem....


    if u find my answer helped u please do mark it as helpful.


    Regards
    Avinash
    Whenever I find the key to success, someone changes the lock.
    Friday, October 16, 2009 4:01 PM
  • Hi,

    You may find the following MSDN page useful (Creating a Microsoft .NET Compact Framework-based Process Manager Application) :-

    http://msdn.microsoft.com/en-us/library/aa446560.aspx

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Friday, October 16, 2009 4:06 PM