locked
How to get window handles in Windows Mobile RRS feed

  • Question

  • Hi,

    I have an application that need to start other applications.  I want to be able to check if the application is already running and if so to just bring it to front rather than attempting to start a new process.  Is there any way to parse through the applications already running on my device and get the windows handle, so i can pInvoke a SetForeGroundWindow using this code:

            [DllImport("coredll.dll")]
            extern public static bool SetForegroundWindow (IntPtr hWnd);

    To run this, when i loop through the processes I need a reliable way to then get the process handle.

    Also, as a side note, when looping through the processes, is there any way to tell if the open window of a process has close or minimize box?

    Thanks very much in advance!



    Rob McCabe
    Sunday, November 29, 2009 1:25 PM

Answers

All replies