HWND GetFocus(VOID);
The GetFocus function retrieves the handle of the window that has the keyboard focus, if the window is associated with the calling thread 's message queue.
测试代码:
var
FocusHandle : THandle;
Buffer : Array [0..255] of Char;
begin
FocusHandle := GetFocus;
GetClassName ( FocusHandle, Buffer, 256 );
ShowMessage ( Buffer );
end;