其中訊息定義可以放在stdafx.h 檔案中。
1. 首先定義乙個訊息**
#define wm_debug wm_user + 1999
2. 在視窗標頭檔案中新增
class cstreamserverdlg : public cdialog
afx_msg
afx_msg void ondebug(wparam wparam, lparam lparam);
...}
3. 在視窗的cpp檔案中新增
begin_message_map(cstreamserverdlg, cdialog)
...on_message(wm_debug, ondebug)
end_message_map()
void cstreamserverdlg::ondebug(wparam wparam, lparam lparam)
{}4. 其他地方就可以傳送訊息
pwnd->postmessage(wm_debug, (wparam)p, 0) )
還得修改以下地方
this->getparent()->sendmessage();
在VC中 新增響應自定義訊息
其中訊息定義可以放在stdafx.h 檔案中。1.首先定義乙個訊息 define wm debug wm user 1999 2.在視窗標頭檔案中新增 class cstreamserverdlg public cdialog afx msg afx msg void ondebug wparam ...
VC 中新增響應自定義訊息
define wm debug wm user 1 2.在視窗標頭檔案中新增 比如mainframe.h class cmainframe public cframewnd afx msg afx msg lresult ondebug wparam wparam,lparam lparam 3.在...
在MFC中新增自定義訊息響應
第 一 在標頭檔案定義訊息字元,n必須大於0,因為wm user以前的用於windows內部定義 define wm my message wm user n 第二 在要響應訊息的窗體的標頭檔案新增 afx msg void onmymessage afx msg 表示的是訊息響應函式,只是乙個標記...