C++/Windows API - 无法找到 CreateWindow

标签 c++ c winapi detours

这是我在 Visual C++ 2010 Express 中的程序的开始:

#pragma comment(lib, "detoured.lib")
#pragma comment(lib, "detours.lib")

#include <Windows.h>
#include <detours.h>

HWND (WINAPI *pCreateWindow)(LPCWSTR lpClassName,
                             LPCWSTR lpWindowName, DWORD dwStyle,
                             int x, int y, int nWidth, int nHeight,
                             HWND hWndParent, HMENU hMenu, HINSTANCE hInstance,
                             LPVOID lpParam) = CreateWindow;

Visual C++ 的 IntelliSense 告诉我它找不到 CreateWindowW(即使我看到它正在查看 Winuser.h 中的#define 并且我可以按 F12 转到函数定义)。它也不会编译。

dllmain.cpp(11): error C2065: 'CreateWindowW' : undeclared identifier

知道发生了什么吗?

谢谢,

迈克

最佳答案

会不会是因为CreateWindowW()真的是一个引用了CreateWindowExW()的宏?

尝试改用 CreateWindowExW()

关于C++/Windows API - 无法找到 CreateWindow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5411776/

相关文章:

c - 使用公共(public)符号链接(symbolic link)两个目标文件

c - 当将 char 指针指向的内存类型转换为无符号整数时,传入的值与预期不符

c++ - Win32 C++ BitBlt 透明度

c++ - 检查给定用户配置文件在 C++ 中是否处于事件状态或已删除的最佳方法是什么?

HttpSendHttpResponse 没有发送数据

c++ - 当在 vector 上使用调整大小时, vector 内部结构中的 unique_ptr 不会编译

c++ - 我应该在 C++ 中分离 cpp 和 h 文件吗?

c++ - 编译器在处理 volatile 内存位置时必须遵循哪些规则?

c++ - 变量类型 global、static、local 和 auto

c - objdump——文件被截断