if GetAsyncKeyState(VK_LButton)<>0 then
dothing;这个是按下左键,那如果要按下左键并放开才做事..改怎么写这个函数?.我写的这个是个鼠标钩子的服务端程序.请问各位大师级别的有什么函数判断?谁告诉我,100分全部相赠.
dothing;这个是按下左键,那如果要按下左键并放开才做事..改怎么写这个函数?.我写的这个是个鼠标钩子的服务端程序.请问各位大师级别的有什么函数判断?谁告诉我,100分全部相赠.
如果必须用鼠标钩子,那就再琢磨琢磨,呵呵var
h: THandle;
m: PMSG; procedure EnableHook; export;
procedure DisableHook; export;
function GetMsgProc(code: integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;implementationprocedure EnableHook; export;
begin
h:= SetWindowsHookEx(WH_GETMESSAGE,@GetMsgProc,HInstance,0);
end;procedure DisableHook; export;
begin
UnhookWindowsHookEx(h);
end;function GetMsgProc(code: integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
result:= 0;
if code < 0 then
begin
result:= CallNextHookEx(h,code,wParam,lParam);
exit;
end
else
begin
if code = HC_ACTION then
begin
m:= PMSG(lParam);
if m^.message = WM_LBUTTONUP then showmessage('LBUTTONDOWN');
end;
end;
end;