16,472
社区成员
发帖
与我相关
我的任务
分享
BOOL CALLBACK TestDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
{
RECT rc;
GetWindowRect(hWnd,&rc);
OutputDebugString(_T("I am TestDlgProc, I receive WM_INITDIALOG, so I has been created !\n"));
GdiplusStartupInput gdiStartupInput;
GdiplusStartup(&m_gdiplusToken,&gdiStartupInput,NULL);
}
break;
case WM_DESTROY:
{
GdiplusShutdown(m_gdiplusToken);
}
break;
case WM_PAINT:
{
RECT rc;
GetWindowRect(hWnd,&rc);
Image img(_T("res\\003.gif"),TRUE);
Graphics graphics(hWnd,TRUE);
const PointF p(10,10);
re = graphics.DrawImage(&img,p);
if(!re == Ok)
{
re = GetLastError();
WCHAR msg[100]={0};
wsprintf(msg,_T("GetLastError is>>%d<<\n"),re);
OutputDebugString(msg);
}
break;
}
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
DestroyWindow(GetParent(hWnd));
EndDialog(hWnd, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}