winapi - Mouse hooking callback not called? -


i'm trying hook mouse this:

#include <windows.h> #include <stdio.h>  hhook mousehook;  lresult winapi mousehookproc(int ncode, wparam wparam, lparam lparam) {     messagebox(0, "not called :-(", "m", 0);      return callnexthookex(mousehook, ncode, wparam, lparam); }  int main() {     mousehook = setwindowshookex(wh_mouse,                                  (hookproc)mousehookproc,                                  getmodulehandle(null),                                  0);      printf("press enter exit.\n");     getchar();      return 0; } 

but messagebox never appears. think everything's ok, seems there's wrong.

thanks in advance.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -