Question

I'm writing some code (in Codelite), was using GetCursorPos(), no problem. But when I want to call GetPhysicalCursorPos(), it says that it's not declared in this scope...

Same with SetCursorPos working ok but not SetPhysicalCursorPos...

They should both work ok as I included windows.h, don't know what to do...

I tried with importing it from user32.dll but it should not be like that...

Thanks for helping me.

Was it helpful?

Solution

The GetPhysicalCursorPos API was only added in Vista/Server 2008. So you need to define

#define WINVER 0x0600

before you include the windows header file. More information on that can be found in the MSDN topic: Using the Windows Headers.

The other possibility is that your header files are out of date. Perhaps the compiler you are using does not ship with an up-to-date SDK. If this is the case then you could try a later version of the compiler, a different compiler, or even the official MS supplied SDK.

One thing you should be aware of is that taking a dependency on this API will mean that your program will not run on XP.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top