I need to somehow hook the SDL created window mouse events ( wheel up and down )
Somehow, in sdl mouse wheel does not seems to work at all...
Found the function: FindWindow
Now i have to get msg somehow.
You can use GetWindowLongPtr and SetWindowLongPtr to get/change a window's WindowProc function. From there you can catch the messages and do your own processing.
Though I never tried to do this out of the current process. It might not work due to security issues.
Security might a problem depending on the platform. In Windows you should be able to get away with this if you enable the "SeDebugPrivilege" in Explorer.exe and as long as your hook process resides in the same session as the target window.
EDIT: If that doesn't work then an injected thread or DLL should have access to the target processes message queue.
It is working but it break my loop.
After registering this testcallback get callback everyframe like this is my new loop.
It is stopping all sdl works, opengl wont work because of that.
I cant somehow stop it. I have no idea what to do next.
I guess i must find a way to hook that mouse wheel up and down in sdl somehow. Im out of ideas...
After registering this testcallback get callback everyframe like this is my new loop.
Well.. yeah...
Your callback is being called for every single message that the window receives. You'll have to filter out the messages you're interested in by looking at the uMsg parameter (ie: look for WM_MOUSEWHEEL)
You'll probably want to call the original window's message handler as well.. so the actual window doesn't just stop responding.