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

Mik*_*and 3 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;
Run Code Online (Sandbox Code Playgroud)

Visual C++的IntelliSense告诉我它无法找到CreateWindowW(即使我看到它在Winuser.h中查看#define而我可以在F12中找到函数定义).它也没有编译.

dllmain.cpp(11): error C2065: 'CreateWindowW' : undeclared identifier
Run Code Online (Sandbox Code Playgroud)

知道发生了什么事吗?

谢谢,

麦克风

Jon*_*ood 8

难道是因为CreateWindowW()真的是一个引用的宏CreateWindowExW()吗?

请尝试使用CreateWindowExW().