Subj : Restore Application on TOP To : borland.public.cpp.borlandcpp From : SVC Date : Mon Jun 21 2004 02:56 pm Greetings, I would like to have one instance of my application running. When an instance is minimized or behind another application (such as Windows Explorer), when I click again on the executable, I would like the running instance to show on top of all other applications. I used the following method: WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { HANDLE hInstanceMutex = ::CreateMutex(NULL,TRUE, "ENZO.MUTEX"); // If application already running if(GetLastError() == ERROR_ALREADY_EXISTS) { if(hInstanceMutex) CloseHandle(hInstanceMutex); Application -> Title = ""; HWND hPrevApp = ::FindWindow(NULL, "Project1"); // Restore the application if(hPrevApp) PostMessage(hPrevApp, WM_SYSCOMMAND, SC_RESTORE, 0); return 0; } try { Application->Initialize(); Application->CreateForm(__classid(TForm1),&Form1); Application->Run(); } catch (Exception &exception) { Application->ShowException(&exception); } return 0; } This works fine when the application is minimize (it pops-up on top of all other applications). It does not work when it is BEHIND other applications (not minimized)! Is there a way of putting my application ON TOP again? I tried also ShowWindow(hPrevApp, SW_RESTORE) without success. Thanks in advance, S. .