if HWND = GetActiveWindow then begin // add your code here end;
if form1.active then ...
if form1.active then ... 没错,是这个
use GetForegroundWindow apifrom msdn: The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.用getActiveWindow有时候会取错误的窗口的:)
begin
// add your code here
end;
没错,是这个
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.用getActiveWindow有时候会取错误的窗口的:)