Hello!
I have a violation of the hook on the mouse at the stage of its creation. I found out the problem, but how to solve, I can not understand.
In general, the thing is this: there is a program in which there is a button, by clicking on which a trap is placed on the mouse and keyboard. Everything works with the keyboard, but the problem with the mouse. As it turned out from the analysis of the work, the hook is broken when, during its creation, the actions that it tracks are performed. That is, if you click on this button in this program itself and start moving it with your mouse (that is, triggering the onmousemove event), the hook will break. If you click on this button, remove your hands from the mouse for a few seconds and then start working, then order with a hook! What can be wrong? Thank you ... and sorry for such a long notation.
Here is the hook handling function:
function wmhook(nCode: Integer; WParam: WPARAM; LParam: LPARAM):LRESULT; stdcall; begin if wparam = WM_LBUTTONDOWN then begin windows.beep(1000, 100); // actions end; if wparam = WM_RBUTTONDOWN then begin windows.beep(2000, 100); // other actions end; Result := CallNextHookEx(hh, nCode, WParam, LParam); end; Function BlockInput(BOOL); from USER32.DLL saved!