From 16c4348b8389e81d4a315d44290a1db99a47936a Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 23 Mar 2019 18:27:40 -0400 Subject: [PATCH] windows fixes --- minigui.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minigui.d b/minigui.d index a04b95e..9699c96 100644 --- a/minigui.d +++ b/minigui.d @@ -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 );