while (TRUE)
{
dwRet = MsgWaitForMultipleObjects (2, hAllEvents, FALSE, INFINITE, QS_ALLINPUT); //等待
switch(dwRet)
{
case WAIT_OBJECT_0: //停止
str.Format("資料采集結束!采集次數=%ld,顯示存盤數量=%ld;",m_daq.daqP.SampleNum,i);
strInfo=str;
break; //break the loop
case WAIT_OBJECT_0+1: // 資料更新
i++;
str.Format("顯示資料個數i=%ld,資料處理次數=%d;",i,m_dpa.dataP.iPrsTimes);
strInfo=str;
SetStatusInfo(strInfo,1);
UpdateShow();
continue;
case WAIT_OBJECT_0 + 2:
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg); ////當滑鼠按住對話框標題欄移動時
}
continue;
default:
break; // unexpected failure
}
break;
}
uj5u.com熱心網友回復:
Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface.看看是不是這個的影響~
我知道用settimer可以克服拖動CListCtrl里面滾動條時卡住的問題,但是對于拖動標題欄或者按住標題欄內最小 最大化按鈕時,同樣是有問題的;所以我在想有沒有徹底解決這些問題的方法,這些問題都是由于dispatchmessage發送出去的訊息都要等待回傳,drag and drop;難道就沒有簡單的方法能夠克服上述缺點的嗎????