简体   繁体   中英

Please explain me what this writing actually means in examples?

If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.

If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_MOUSE hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the target window procedure.

I find it here and I am no good at English as well as this hooking stuff but I must do it as required. If you could explain me what it actually means with simple examples, I am really thankful. Please help me.... Thank you

In pseudocode it means approx this:

if (nCode < 0) return CallNextHookEx();
else if (nCode >= 0 && !MsgProcessed) return CallNextHookEx();
else
     return 1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM