I would like to have the text of an Edit Box on a dialog that pops up to be set at that time. However, my code seems to be useless. It compiles with no errors or warnings but doesn't do anything. Here is my code:
// Mesage handler for New File box.
LRESULT CALLBACK NewFileDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
char word[6]={'h','e','l','l','o','\0'}; //The string to be set into the edit box control
switch (message)
{
case WM_INITDIALOG:
SendMessage(
(HWND) IDC_MEASURES, //The edit box control
(UINT) WM_SETTEXT,
(WPARAM) wParam,
(LPARAM) lParam = *word
);
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
I'm a beginning programmer so please tell me if I'm doing all of this wrong.
// Mesage handler for New File box.
LRESULT CALLBACK NewFileDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
char word[6]={'h','e','l','l','o','\0'}; //The string to be set into the edit box control
switch (message)
{
case WM_INITDIALOG:
SendMessage(
(HWND) IDC_MEASURES, //The edit box control
(UINT) WM_SETTEXT,
(WPARAM) wParam,
(LPARAM) lParam = *word
);
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
I'm a beginning programmer so please tell me if I'm doing all of this wrong.