15,979
社区成员
发帖
与我相关
我的任务
分享
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)
{
PAINTSTRUCT ps;
switch(msg)
{
case WM_ERASEBKGND:
return true;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
::GetClientRect(hwnd,&rect);
hmendc=CreateCompatibleDC(hdc);
hbtm=LoadBitmap(hInst,MAKEINTRESOURCE(bit[0]));
SelectObject(hmendc,hbtm);
GetObject(hbtm,sizeof(BITMAP),&bitmap);
StretchBlt(hdc,0,0,rect.right,rect.bottom,hmendc,0,0,bitmap.bmWidth,bitmap.bmHeight,SRCCOPY);
::TextOut(hdc,100,100,"图书管理系统",strlen("图书管理系统"));
::DeleteObject(hbtm);
DeleteDC(hmendc);
EndPaint(hwnd,&ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,msg,wparam,lparam);
}
return 0;
}