WM_PAINT Hook using SetWindowsHookEx
Here Goes My Code // hook.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <iostream> using namespace std; LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lParam); int _tmain(int argc, _TCHAR* argv[]){ int __; cout << "Hallo World" << endl; SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, 0, 0); cin >> __; return 0; } LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lParam){ cout << code << endl; return 0; } I am trying to get WM_PAINT event... at the moment I am trying to trap all the events. Where I am Missing ?