﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1466	_GUICtrlEdit_GetLine returns an unexpected character	ProgAndy	Jon	"When using _GUICtrlEdit_GetLine, an unexpected character is appended. Here is the corrected function.
{{{
; #FUNCTION# ====================================================================================================================
; Name...........: _GUICtrlEdit_GetLine
; Description ...: Retrieves a line of text from an edit control
; Syntax.........: _GUICtrlEdit_GetLine($hWnd, $iLine)
; Parameters ....: $hWnd        - Handle to the control
;                  $iLine       - Zero-based line index to get
; Return values .: Success      - The line of text
;                  Failure      - Empty string
; Author ........: Gary Frost (gafrost), Jos van der Zande <jdeb at autoitscript com >
; Modified.......: Gary Frost (gafrost)
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GUICtrlEdit_GetLine($hWnd, $iLine)
	If $Debug_Ed Then __UDF_ValidateClassName($hWnd, $__EDITCONSTANT_ClassName)
	If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)

	Local $iLength = _GUICtrlEdit_LineLength($hWnd, $iLine)
	If $iLength = 0 Then Return """"
	Local $tBuffer = DllStructCreate(""short Len;wchar Text["" & $iLength & ""]"")
	Local $pBuffer = DllStructGetPtr($tBuffer)
	DllStructSetData($tBuffer, ""Len"", $iLength + 1)
	Local $iRet = _SendMessage($hWnd, $EM_GETLINE, $iLine, $pBuffer, 0, ""wparam"", ""ptr"")

	If $iRet = 0 Then Return SetError($EC_ERR, $EC_ERR, """")

	Local $tText = DllStructCreate(""wchar Text["" & $iLength & ""]"", $pBuffer)
	Return DllStructGetData($tText, ""Text"")
EndFunc   ;==>_GUICtrlEdit_GetLine
}}}"	Bug	closed	3.3.5.5	Standard UDFs	3.3.5.3	None	Fixed		
