C++ WinAPI 'AnimateWindow' 尚未声明

标签 c++ winapi

我正在尝试制作 WinAPI C++ 程序,但我遇到了以下错误:

error: 'AW_SHOW' was not declared in this scope
error: 'AW_HIDE' was not declared in this scope
error: 'AW_BLEND' was not declared in this scope
error: 'AnimateWindow' was not declared in this scope
error: 'SW_MINIMISE' was not declared in this scope

我尝试使用::AnimateWindow 但是我收到了同样的错误。 这是我的头文件,包含在windows.h之前

#ifdef WINVER
#undef WINVER
#endif

#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif

#define WINVER 0x0500
#define _WIN32_WINNT 0x0500

我还尝试将变量设置为 0x0502,并在 Winuser.h 中为 AnimateWindow 注释掉预处理器。

最佳答案

想通了。

发生错误的文件包含在我的 main.cpp 中,但它包含在 main.cpp 中的 windows.h 之后。

关于C++ WinAPI 'AnimateWindow' 尚未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10667431/

相关文章:

c++ - 包含标题的一些规则是什么?

c++ - Eclipse C/C++ (CDT) 切换工作空间(共享)

c# - 我怎样才能知道EntryPoint中指定的Ordinals符号代表的函数

c++ - 特定窗口c++的屏幕截图

c++ - 终止 PPL 线程池中的线程

python - 如何在 Windows 上打开包含选定项目的文件夹

c++ - 使用 GDI 将文本旋转 90 度

c++ - 这是函数声明吗?

c++ - 我怎样才能使这个模板方法更优雅? (或 : less explicit template parameters required)

c++ - QWidget::createWindowContainer 的绘图错误和崩溃