Hello !!!
I need some help with a .NET application for Pocket PC... I have an application that can be executed multiple times (multiple instances are in memory at the same time), and the application consists of a form with a button placed on it... What I need to do is, when I press the button, the application must bring the other application's main form to front... Is there a function in the Win32 API that I can use with the DllImport attribute???
In oter words, I need to find the currently executing processes, and bring to front, the main form of one of the processes...
Cristian SoraPosted Apr 10, 2008, 10:46 AM
Mike GoldPosted Apr 8, 2008, 11:23 PM
you probably need to PInvoke the following, but this should lead you in the correct direction. Not sure which dll (could be core, but not sure)
// Allow only one instance of the application. HWND hWnd = FindWindow (szAppName, NULL); if (hWnd) { SetForegroundWindow ((HWND)(((DWORD)hWnd) | 0x01)); return -1; }