From 124f878dd95398c278bdc96e47eb7357e6a63f17 Mon Sep 17 00:00:00 2001 From: micha Date: Mon, 18 Oct 2004 16:22:24 +0000 Subject: [PATCH] fix combobox text selection methods according to msdn specs git-svn-id: trunk@6152 - --- lcl/interfaces/win32/win32wsstdctrls.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/win32/win32wsstdctrls.pp b/lcl/interfaces/win32/win32wsstdctrls.pp index f042b8d6a8..18f4977040 100644 --- a/lcl/interfaces/win32/win32wsstdctrls.pp +++ b/lcl/interfaces/win32/win32wsstdctrls.pp @@ -568,12 +568,15 @@ end; function TWin32WSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox): integer; begin - Result := Low(SendMessage(ACustomComboBox.Handle, CB_GETEDITSEL, Windows.WPARAM(nil), Windows.LPARAM(nil))); + SendMessage(ACustomComboBox.Handle, CB_GETEDITSEL, Windows.WPARAM(@Result), Windows.LPARAM(nil)); end; function TWin32WSCustomComboBox.GetSelLength(const ACustomComboBox: TCustomComboBox): integer; +var + startPos, endPos: dword; begin - Result := SendMessage(ACustomComboBox.Handle, CB_GETEDITSEL, Windows.WPARAM(nil), Windows.LPARAM(nil)); + SendMessage(ACustomComboBox.Handle, CB_GETEDITSEL, Windows.WPARAM(@startPos), Windows.LPARAM(@endPos)); + Result := endPos - startPos; end; procedure TWin32WSCustomComboBox.SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle);