OK, I am using the VC that comes VS 2005
I created a new empy Win32 project setup for dll
it compiles fine except no dll is out put....Code:/******************************************************** * * El Hooko * *********/ #define WIN32_LEAN_AND_MEAN #include <windows.h> extern "C" __declspec(dllexport) void SetHook(); extern "C" __declspec(dllexport) void ReleaseHook(); extern "C" __declspec(dllexport) __w64 long __stdcall HProc(int nCode, WPARAM wParam, LPARAM lParam); HHOOK _hook = NULL; HINSTANCE _hInst = NULL; extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { _hInst = hInstance; //store HINSTANCE return true; //continue } extern "C" __declspec(dllexport) void SetHook() { //find guild wars LPCWSTR cls = (LPCWSTR)"WNDCLASS"; HWND hWnd = FindWindow(cls, NULL); DWORD pid = NULL; DWORD tid = GetWindowThreadProcessId(hWnd, &pid); _hook = SetWindowsHookEx(WH_CALLWNDPROC, HProc, _hInst, tid); } extern "C" __declspec(dllexport) void ReleaseHook() { UnhookWindowsHookEx(_hook); } extern "C" __declspec(dllexport) __w64 long __stdcall HProc(int nCode, WPARAM wParam, LPARAM lParam) { return CallNextHookEx(_hook, nCode, wParam, lParam); }
help plz




Reply With Quote