To define a background process and go to the forefront in C ++ WIN32

Can someone tell me how to identify a specific background process (i.e. an already running application) and bring it to the fore? For example, if the Notepad application is running in the background, when I start the WIN32 application, it should identify the Notepad application, and the notepad should appear or come to the fore.

I tried the SwitchToThisWindow () function, but it works like Alt + tab. It will not identify the background process.

Pls offers me a guide on how to go about this.

Thank..

+5
source share
2 answers

But is there a way to identify the background process

Unix, Windows . 10 "" , , , 50 , . , . Alt + Tab . SetForegroundWindow() .

+3

, " ", :

EnumWindows HWND . , , . Spy ++, , HWND, HWND :

HWND ( IsWindowVisible WS_VISIBLE).

WS_POPUP - , , , ..

( ), GetGUIThreadInfo idThread = 0; GUIHREADINFO.hwndActive , HWND , .

, IsIconic (hwnd).

, , "", GetWindowText, , GetWindowThreadProcessId, .

+3

All Articles