Click to See Complete Forum and Search --> : runtime creation -- help


evon_liu
October 25th, 1999, 01:35 PM
How do I create a static control at runtime using
createwindow() without giving all hardcoded coordinates?
For instance a string is loaded from the resource file using loadstring(), and I'd like to create a static control with the string as the label but using the actual width and height of the label as the width and height in createwindow()..
LoadString(resource, STR,
achStatic,sizeof(achStatic));
hwndCtl = CreateWindow("static", achStatic,
WS_CHILD | WS_VISIBLE | WS_GROUP,
18, 13, width, height hwnd, (HMENU)-1, null, NULL);

SendMessage(hwndCtl, WM_SETFONT, (WPARAM) lpFolderData->hFont, MAKELPARAM(TRUE, 0));

how do I calculate the width and height of achStatic? Obviously, this has to do with I18N of my program.

Thanks.