Here’s the start of my program in 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++’s IntelliSense is telling me that it can’t find CreateWindowW (even though I see it looking at the #define in Winuser.h and I can F12 to go to the function definition). It doesn’t compile, either.
dllmain.cpp(11): error C2065: 'CreateWindowW' : undeclared identifier
Any idea what’s happening?
Thanks,
Mike
Could it be because
CreateWindowW()is really a macro that referencesCreateWindowExW()?Try using
CreateWindowExW()instead.