Dll injection + подмена оконной процедуры
Код:
LRESULT CALLBACK NewWindowProc(HWND hWnd, UINT msg, WPARAM w, LPARAM l)
{
if (msg == WM_MENUCOMMAND) Notify("Клик");
return CallWindowProc(OldWindowProc, hWnd, msg, w, l);
}
...
OldWindowProc = (WNDPROC)SetWindowLong(mainHandle, GWL_WNDPROC, (long)NewWindowProc);
{
if (msg == WM_MENUCOMMAND) Notify("Клик");
return CallWindowProc(OldWindowProc, hWnd, msg, w, l);
}
...
OldWindowProc = (WNDPROC)SetWindowLong(mainHandle, GWL_WNDPROC, (long)NewWindowProc);