win+a按下后,showmessage Focus控件的Text,没调式,你看看吧
//注册热键win+a
procedure TForm1.FormCreate(Sender: TObject);
begin
; RegisterHotKey(Handle, 1001, MOD_Win, 65);
end;
{消息重载 WM_HOTKEY}
procedure TForm1.WMHotKey(var Msg: TMessage); ;
var
; ActiveHandle: THandle; ;//当前活动窗体ThreadID
; FocusHandle: THandle; ;//焦点控件
; CurHandle: THandle; ; ;//本程序ThreadID
; Buffer: array [0..4096] of Char;
begin
; if Msg.WParam = 1001 then ;//
; begin
; ; CurHandle := GetCurrentThreadID;
; ; ActiveHandle := GetWindowThreadProcessID(GetForeGroundWindow, nil);
; ; AttachThreadInput(CurHandle, ActiveHandle, True);
; ; FocusHandle := GetFocus;
; ; SendMessage(FocusHandle, WM_GETTEXT, 0, Integer(@Buffer[0]));
; ; ShowMessage(StrPas(@Buffer));
; ; AttachThreadInput(CurHandle, ActiveHandle, False);
; end;
; inherited;
end;