有人可以向我解释为什么这段代码不起作用吗?
PAINTSTRUCT ps;
HDC hdc;
TCHAR str[] = _T("An example of SetTextJustification function");
消息循环中的代码:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
if(!SetTextJustification(hdc, 40, 4));
{
MessageBox(NULL, _T("Call to SetTextJustification failed!"), _T("Error"), NULL);
}
TextOut(hdc, 20, 20, str, _tcslen(str));
EndPaint(hWnd, &ps);