2 minutes ago, b2soft said:in such case I need to manage focus states of the window
Well, checking if your application window is active is just another function call. I think this solution is much more convenient than fighting an event-based system which doesn't have games in mind. I don't really see any advantage in writing twenty lines of code to retrieve the cursor position. Especially not in a full-screen FPS where the only thing you need is just a mouse delta.
1 minute ago, JoeJ said:Sounds interesting. But i guess you still have to use SetCursorPos, and a useless message is generated?
Yes, you'd still need SetCursorPos, but useless messages can be silently ignored. In fact, you are ignoring tons of messages anyway so this doesn't matter at all. Spy++ is a handy tool for monitoring such things BTW..