在delphi/bcb中有application.processMessage,不知道VC中是否有类似的函数?或者该如何做

解决方案 »

  1.   

    SendMessage或者是直接的函数调用!
      

  2.   

    BOOL ProcessMessages(void) 
    {
    MSG msg;
    BOOL ret=TRUE;
    /* get the next message if any */
    while(ret)
    {
    ret = (BOOL)PeekMessage(&msg,NULL,0,0,PM_REMOVE);
    /* if we got one, process it */
    if (ret) {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    }
    /* TRUE if we got a message */
    return ret;
    }call the above function to process message queue
      

  3.   

    masterz(www.fruitfruit.com) 大虾,好久不见啊:)
      

  4.   

    偶像回归,实际上就是消息循环,只不过MFC主线程中的消息处理是通过消息映射来完成的,也可以在 PreTranslateMessage 中提前处理
    工作线程中的方法就如 masterz 提供的函数,用于处理当前线程的消息