方法一。进入MSMQ的管理工具里删除消息。
方法二。MSMQ有一个取消息的方法(具体名字忘了,对不起,大概叫Receive),把消息取出后,队列中就没有消息了。

解决方案 »

  1.   

    如果是自己程序中的,忽略不就行了?如果是别的程序中的,挂住WH_CALLWNDPROC钩子
      

  2.   

    用API函数:
    BOOL 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
    );
    其中wRemoveMsg参数取值如下:
    1、PM_NOREMOVE: Messages are not removed from the queue after
                    processing by PeekMessage. 
    2、PM_REMOVE: Messages are removed from the queue after processing by  
                  PeekMessage.
    祥见MSDN 
      

  3.   

    如果删除消息队列中的消息?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    那他还没见到windows的太阳就消失了,
    世界好象什么也没发生过一样!
    呵呵