1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
// Create Static control
HFONT hfDefault;
HWND hStatic1;
hStatic1 = CreateWindowEx(WS_EX_CLIENTEDGE, "static", NULL,
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL,
0, 0, 100, 100, hwnd, (HMENU)IDC_CHILD_STATIC1,
GetModuleHandle(NULL), NULL);
if(hStatic1 == NULL)
{
MessageBox(hwnd, "Could not create Static control !", "Error",
MB_ICONERROR | MB_OK);
}
hfDefault = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hStatic1, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
}
| |