我输出了文字,但他爬过我的窗口区域,我该如何解决?这是我的代码的一部分
PAINTSTRUCT ps;
hdc=BeginPaint(hWnd3,&ps);
LOGFONT lf;
lf.lfWidth=0;
lf.lfHeight=14;
strcpy(lf.lfFaceName,"Times New Roman");
lf.lfEscapement=lf.lfStrikeOut=lf.lfUnderline=0;
lf.lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf.lfCharSet=1251;
lf.lfOrientation=0;
hf=CreateFontIndirect(&lf);
SelectObject(hdc,hf);
SetTextAlign(hdc,TA_CENTER);
GetClientRect(hWnd,&r);
TextOut(hdc,r.right/2,r.bottom/2,"Some text",strlen("Some text"));
DeleteObject(hf);
EndPaint(hWnd3,&ps);
文本将比“某些文本”长得多。