gpt4 book ai didi

c++ - GetCursorPos 工作正常但 GetPhysicalCursorPos "not declared in this scope"?

转载 作者:行者123 更新时间:2023-11-30 04:10:59 29 4
gpt4 key购买 nike

我正在编写一些代码(在 Codelite 中),使用的是 GetCursorPos(),没问题。但是当我想调用 GetPhysicalCursorPos() 时,它说它没有在此范围内声明...

与 SetCursorPos 一样工作正常但 SetPhysicalCursorPos 不行...

他们应该都能正常工作,因为我包含了 windows.h,不知道该怎么做...

我尝试从 user32.dll 导入它,但它不应该是那样的......

谢谢你帮助我。

最佳答案

GetPhysicalCursorPos API是在Vista/Server 2008才加入的,所以需要定义

#define WINVER 0x0600

在包含 windows 头文件之前。有关更多信息,请参见 MSDN 主题:Using the Windows Headers .

另一种可能是您的头文件已过时。也许您使用的编译器没有附带最新的 SDK。如果是这种情况,那么您可以尝试更高版本的编译器、不同的编译器,甚至是 MS 官方提供的 SDK。

您应该注意的一件事是,依赖此 API 将意味着您的程序将无法在 XP 上运行。

关于c++ - GetCursorPos 工作正常但 GetPhysicalCursorPos "not declared in this scope"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20380484/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com