SetWindowsHookEx failing in .NET 4.0 on 32-bit machine with “module not found”?

前端 未结 3 1937
离开以前
离开以前 2020-11-30 07:39

I have found similar questions on this page, but I can\'t seem to figure out how to interpret the answers or figure out if they are truly duplicates.

Here are the pos

3条回答
  •  误落风尘
    2020-11-30 08:19

    In .Net 4.0 for this code to work I had to replace the call:

    SetWindowsHookEx(WH_KEYBOARD_LL, _Hook, moduleHandle, 0);

    with:

    SetWindowsHookEx(WH_KEYBOARD_LL, _Hook, IntPtr.Zero, 0);

    this fixed the problem ,This works when the call is made from the same module.

    I got this from here

提交回复
热议问题