|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
想利用Message的返回值 在已经 画好的 窗口上 写上内容 , 这样写回调,无法实现啊。。。为什么??
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch(uMsg)
{
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
case WM_NCRBUTTONDOWN:
{
int result;
result = MessageBox(NULL, TEXT("你好!"), TEXT("Ture!"), MB_YESNO);
if (result == IDYES)
{
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd,&rect);
DrawText(hdc, TEXT("有美女吗?"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint(hWnd,&ps);
return 0;
}
}
default:
{
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
}
return 0;
}
|
|