Charles Petzold 在其 Programming Windows一书第三章Queued and Nonqueued Messages一节中写道:
QUOTE:
the window procedure could call a function that sends the window procedure another message, in which case the window procedure must finish processing the second message before the function call returns, at which time the window procedure proceeds with the original message. For example, when a window procedure calls UpdateWindow, Windows calls the window procedure with a WM_PAINT message. When the window procedure finishes processing the WM_PAINT message, the UpdateWindow call will return controls back to the window procedure.
于是我做了一个小试验,代码如下:
static char i[2] = {'0','\0'};
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, "start", 5, &rt, DT_CENTER);
EndPaint(hWnd, &ps);
SendMessage(hWnd, WM_PAINT,0 ,0);
MessageBox(hWnd,i,"paint",0);
DrawText(hdc, "end", 3, &rt, DT_CENTER);
EndPaint(hWnd, &ps);
i[0] = i[0]+1;
break;
按照上面文章的说法,我应该看不到任何MessageBox()起作用才对啊..
我理解错了吗?望各位高人指教.

[ 本帖最后由 dr33 于 2006-8-20 02:21 编辑 ]