zoukankan      html  css  js  c++  java
  • PeekMessage() 与 GetMessage() 区别

    function Parameters Return Values
    PeekMessage LPMSG lpMsg,
    pointer to structure for message

    HWND hWnd
    handle to window

    UINT wMsgFilterMin
    first message

    UINT wMsgFilterMax
    last message

    UINT wRemoveMsg
    removal flags
    BOOL

    Remarks 
    If a message is available, the return value is nonzero.
    If no messages are available, the return value is zero.


    function Parameters Return Values
    GetMessage LPMSG lpMsg
    address of structure with message

    HWND hWnd
    handle of window

    UINT wMsgFilterMin
    first message

    UINT wMsgFilterMax
    last message
    BOOL

    Remarks 
    If the function retrieves a message other than WM_QUIT, the return value is nonzero.
    If the function retrieves the WM_QUIT message, the return value is zero.
    If there is an error, the return value is -1. For example, the function fails if hWnd is an invalid window handle or lpMsg is an invalid pointer. To get extended error information, callGetLastError.


    Example

    PeekMessage

     while (!bQuit)
        {
            if (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
            {
                if (msg.message == WM_QUIT)
                {
                    bQuit = TRUE;
                }
                else
                {
                    TranslateMessage (&msg);
                    DispatchMessage (&msg);
                }
            }

    GetMessage

    while (GetMessage(&msg, NULL, 0, 0))
        {
            if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
  • 相关阅读:
    2018-8-10-wpf-绑定-DataGridTextColumn-
    行踪隐藏 代理助手
    木马防杀 花指令 OllyDbg
    木马加壳
    elsave.exe日志清除
    黑客小工具
    WinRAR捆绑木马
    网页木马使用
    灰鸽子商业版用法
    黑洞远程连接
  • 原文地址:https://www.cnblogs.com/laohaozi/p/12538378.html
Copyright © 2011-2022 走看看