Text being automatically selected: WM_SETTEXT
Hi,
This strikes me as pretty silly, but I can't figure out why this is happening.
I've got the following code (in highly cut-down form):
Code:
LRESULT CALLBACK HelpAboutDlgBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
static char outbuf[UV_MAXANALEN];
static HWND help_abt;
switch (message)
{
/* Use messages to update, etc */
case WM_INITDIALOG:
help_abt = GetDlgItem(hDlg, HELP_ABT); // Multiline edit area
strcpy(outbuf, "A lot of text");
SendMessage(help_abt, WM_SETTEXT, (WPARAM)NULL, (LPARAM)outbuf);
return TRUE;
break;
case WM_COMMAND:
...
break;
default:
break;
}
return FALSE;
}
For some reason, the text when displayed is being selected (as if with Control-A) and yet I'm doing nothing to achieve this. The effect is undesired.
HELP_ABT is defined as follows:
Code:
EDITTEXT HELP_ABT, 32, 23, 293, 102, ES_MULTILINE | ES_READONLY | WS_VSCROLL
Is there anything wrong with the above code fragment that would give rise to this?
TIA!