MFC自己有一个窗口过程吧,但是如果我自己建立一个窗口过程,他怎么分辨的呢?
窗口过程的作用是??谢谢mfc窗口过程
窗口过程的作用是??谢谢mfc窗口过程
解决方案 »
- GetBufferSetLength后需要ReleaseBuffer吗
- 若Combo下紧临一个控件,当拉了一次Combo后,下面的控件会被覆盖住
- 为什么应用程序先执行ExitInstance,而链入的MFC DLL后执行ExitInstance?我该怎么办?急!!!
- 急!对话框按钮不能点!
- 我在程序里定义了一个vector,为什么打出点后面显示不出方法。
- 请问我错在哪儿?
- 如何将LISTCTRL中的内容导出到文本文件中?
- 职业定位!给个参考@、
- 急问。。。。如何在字符串中加入单引号
- 高手请进,opendocumentfile问题
- 让指定矩形区域可以用鼠标拖动,其他地方不行怎么实现
- via提供程序:找不到指定的模块
的消息route 你没看过吧!看这个!http://blog.csdn.net/wangyao1052/article/details/8045017
也就是说默认MFC会为你提供一个主线程,也就是派生自CWinApp的CMyApp类对应的run()如果你要重新建立一个窗口过程,那就要从CWinThread派生出一个新的类
然后重写这个类的run,这就是你要的窗口过程
这样的话你肯定就能识别自己的线程处理函数了
在你的派生类里重写run就能响应你感兴趣的消息int CWinThread::Run()
{
ASSERT_VALID(this); // for tracking the idle time state
BOOL bIdle = TRUE;
LONG lIdleCount = 0; // acquire and dispatch messages until a WM_QUIT message is received.
for (;;)
{
// phase1: check to see if we can do idle work
while (bIdle &&
!::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE))
{
// call OnIdle while in bIdle state
if (!OnIdle(lIdleCount++))
bIdle = FALSE; // assume "no idle" state
} // phase2: pump messages while available
do
{
// pump message, but quit on WM_QUIT
if (!PumpMessage())
return ExitInstance(); // reset "no idle" state after pumping "normal" message
if (IsIdleMessage(&m_msgCur))
{
bIdle = TRUE;
lIdleCount = 0;
} } while (::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE));
} ASSERT(FALSE); // not reachable
}