Warning: file_get_contents(https://whois.pconline.com.cn/jsLabel.jsp?ip=127.0.0.1) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable in D:\wwwroot\huidong\wwwroot\function.inc.php on line 884
重新设置一个窗口的WinProc消息响应函数,并实现中途监听消息,再传回原来的消息响应函数 - huidong

huidong

首页 | 会员登录 | 关于争取 2022 寒假做出汇东网 Ver3.0.0 !
搜索文章


http://www.huidong.xyz/?mode=2&id=148 这里面也用到了中途监听消息,再传回原来的消息响应函数。

WNDPROC OldProc = (WNDPROC)GetWindowLong(hWnd, GWL_WNDPROC);    // 得到原来的消息响应函数
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)NewProc);                // 设置现在的消息响应函数
// 响应消息
LRESULT CALLBACK NewProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int WndWidth;
    int WndHeight;

    switch (message)
    {
    case WM_SIZE:
        WndWidth = LOWORD(lParam);
        WndHeight = HIWORD(lParam);
        break;
    default:
        return CallWindowProc(OldProc, hWnd, message, wParam, lParam);    // 调用一个消息响应函数
        break;
    }

    return 0;
}




返回首页


Copyright (C) 2018-2024 huidong