Hi,
I have a global timer in my app that drives the opengl window created during runtime. I’m creating it using:
SetTimer(NULL, 0, 10, tick);
where tick is my TimerProc. In my app main loop, I have:
MSG msg;
while(GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
This triggers a callback in tick as I expect. If I create an HWND and attach an opengl context to it, it still works fine. The issue is when I call SetWindowLongPtr to attach a userdata to the HWND. As soon as I call:
SetWindowLongPtr(hwnd, GWLP_USERDATA, udata);
the timer stops. Only after I close the window does the timer kick back in again. Obviously, the window is somehow taking over the WM_TIMER calls somehow, but I can’t quite find out why. The docs don’t mention anything about messages getting stolen by calling SetWindowLongPtr. Any ideas?