C++ WinAPI 'AnimateWindow'尚未声明

C++ WinAPI 'AnimateWindow' has not been declared

本文关键字:未声明 AnimateWindow WinAPI C++      更新时间:2023-10-16

我正在尝试制作一个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 之后。