Hi,
First of all, you need to be careful on what function you're using.
SendMessage will send window message to a window handle.
SendDlgMessage will send window message to a window handle (acting as dialog).
That's why you can't use EM_SETSEL is because neither of the window you're trying to "copy" data from is/are an EditBox.
To solve this, you need to "send" the message to the item itself, hence I recomment you to use the function that will send the message directly to the dialog item, which is the
SendDlgItemMessage function. This should work:
invoke SendDlgItemMessage, hDialog, IDC_EDIT_OUTPUT, EM_SETSEL, 0, -1
invoke SendDlgItemMessage, hDialog, IDC_EDIT_OUTPUT, WM_COPY, 0, 0
invoke SendDlgItemMessage, hDialog, IDC_EDIT_OUTPUT, EM_SETSEL, -1, 0
where hDialog is the window handle of your DialogBox containing the EditBox having the id IDC_EDIT_OUTPUT.
Cheers,
-chris
Chris Vega
This posting is provided "AS IS" with no warranties, and confers no rights
My Weblog|
Visit MSDN Community