-6

How to check in Process object is Focused? Please reply with c++ od c# code Thanks in advance.

4

1 回答 1

2

You can use this code based on GetForegroundWindow()

var process = GetForegroundWindow();
if (process != IntPtr.Zero) {
    return true;       // he has focus
}
于 2012-09-03T18:09:24.270 回答