M
1.) zum beispiel leerzeichen in deine beschriftung einfügen bsp:" File "
2.) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowpos.asp
ein altes beispiel, vielleicht auch nicht ganz optimal
void CenterWindow(HWND hwndChild, HWND hwndParent)
{
RECT rcChild;
RECT rcParent;
int wChild;
int hChild;
int wParent;
int hParent;
int wScreen;
int hScreen;
int xNew;
int yNew;
HDC hdc;
GetWindowRect(hwndChild, &rcChild);
wChild = rcChild.right - rcChild.left;
hChild = rcChild.bottom - rcChild.top;
GetWindowRect(hwndParent, &rcParent);
wParent = rcParent.right - rcParent.left;
hParent = rcParent.bottom - rcParent.top;
hdc = GetDC(hwndChild);
wScreen = GetDeviceCaps(hdc, HORZRES);
hScreen = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(hwndChild, hdc);
xNew = rcParent.left + ((wParent - wChild) /2);
if(xNew < 0)
xNew = 0;
else if((xNew + wChild) > wScreen)
xNew = wScreen - wChild;
yNew = rcParent.top + ((hParent - hChild) /2);
if(yNew < 0)
yNew = 0;
else if((yNew + hChild) > hScreen)
yNew = hScreen - hChild;
SetWindowPos(
hwndChild,
NULL,
xNew,
yNew,
0,
0,
SWP_NOSIZE | SWP_NOZORDER);
}
3.) WS_CLIPCHILDREN oder WS_CLIPSIBLINGS (weis es nicht mehr genau ) sollte beim erstellen des fensters mit angegeben sein.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/WindowsUserInterface/Windowing/windows/WindowReference/WindowStyles.asp