定义窗口过程:
typedef LRESULT CALLBACK oldProc(
_In_ HWND hwnd,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
oldProc* _oldProc;
LRESULT CALLBACK webProc(
_In_ HWND hwnd,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
)
{
return _oldProc(hwnd, uMsg, wParam, lParam);
}
调用的地方:
_oldProc = (oldProc*)GetWindowLong(handle, GWL_WNDPROC);
SetWindowLong(handle, GWL_WNDPROC, (LONG)webProc);
C++拦截窗口过程
最新推荐文章于 2021-11-29 10:26:01 发布