目前問題為 使用SetWindowText 會提示 非晶態成員函式的非法呼叫,
uj5u.com熱心網友回復:
執行緒中PostMessage發送給主執行緒,讓主執行緒來操作修改UI。作業執行緒不能直接修改UIuj5u.com熱心網友回復:
執行緒中直接操作UI是比較危險的,可以用PostMessage的方式,交給主執行緒處理uj5u.com熱心網友回復:
WM_SETTEXTAn application sends a WM_SETTEXT message to set the text of a window.
WM_SETTEXT
wParam = 0; // not used; must be zero
lParam = (LPARAM)(LPCTSTR)lpsz; // address of window-text string
Parameters
lpsz
Value of lParam. Pointer to a null-terminated string that is the window text.
Return Values
The return value is TRUE if the text is set. It is FALSE (for an edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control.
endMessage(g_hEdit,WM_SETTEXT,0,(LPARAM)szBuffer);
uj5u.com熱心網友回復:
用API的 SetWindowText轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/150768.html
標籤:進程/線程/DLL
下一篇:win32鍵盤事件中的延遲情況
