Fixed with SetWindowsHookEx(WH_CALLWNDPROCRET,HookCallbackFunction,GetModuleHandle(NULL),GetCurrentThreadId());