I have a editline inside a dialogbox,
how can i transer the contents in the editline into a global character-string, when the user press a OK-button in the dialog? :confused:
Printable View
I have a editline inside a dialogbox,
how can i transer the contents in the editline into a global character-string, when the user press a OK-button in the dialog? :confused:
When the user presses an OK-button in the dialog, a WM_COMMAND message is sent to the dialog. Handle it by grabbing the editline text into your global character-string.
[edit]Code:case WM_COMMAND:
{
int id = LOWORD( wParam ); // get the identifier of the control
if( id == MY_BUTTON_ID )
{
GetDlgItemText( hDialog, MY_EDITLINE_ID, globalBuffer, GLOBAL_BUFFER_LENGTH );
}
return TRUE;
}
Forgot that we're working with dialogs. Changed return 0; to return TRUE.