windows fixes

This commit is contained in:
Adam D. Ruppe 2019-03-23 18:27:40 -04:00
parent af47ae19c2
commit 16c4348b83
1 changed files with 3 additions and 3 deletions

View File

@ -5576,15 +5576,15 @@ abstract class EditableTextWidget : EditableTextWidgetParent {
} else version(win32_widgets) {
// get the current selection
DWORD StartPos, EndPos;
SendMessageW( hwnd, EM_GETSEL, cast(WPARAM)(&StartPos), cast(WPARAM)(&EndPos) );
SendMessageW( hwnd, EM_GETSEL, cast(WPARAM)(&StartPos), cast(LPARAM)(&EndPos) );
// move the caret to the end of the text
int outLength = GetWindowTextLengthW( hwndOutput );
int outLength = GetWindowTextLengthW( hwnd );
SendMessageW( hwnd, EM_SETSEL, outLength, outLength );
// insert the text at the new caret position
WCharzBuffer bfr = WCharzBuffer(txt, WindowsStringConversionFlags.convertNewLines);
SendMessageW( hwnd, EM_REPLACESEL, TRUE, txt );
SendMessageW( hwnd, EM_REPLACESEL, TRUE, cast(LPARAM) bfr.ptr );
// restore the previous selection
SendMessageW( hwnd, EM_SETSEL, StartPos, EndPos );