Ok, I have created a button control during runtime, and I want to know how I can handle it. I tried using GetDlgItem() in many different ways but it doesn't work. My WM_CREATE message looks like this:
Code:
case WM_CREATE:
{
HFONT hfDefault;
HWND hEdit;
HWND hButton;
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,
"EDIT",
"",
WS_VISIBLE | WS_CHILD,
0,0,0,0,
hwnd,
(HMENU)IDC_MAIN_EDIT,
GetModuleHandle(NULL),
NULL);
hButton = CreateWindowEx(0,
"BUTTON",
"whatever",
WS_VISIBLE | WS_CHILD,
120,150,100,20,
hwnd,
(HMENU)IDC_MAIN_BUTTON,
GetModuleHandle(NULL),
NULL);
hfDefault = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hEdit,WM_SETFONT,(WPARAM)hfDefault,MAKELPARAM(false,0));
}
break;
also, can someone explain to me how using the MAKELPARAM() macro and filling it in with false and 0 make a lparam appropriate for my message.