﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
4038	_GUICtrlRichEdit_StreamToFile adds new paragraph at the end on every open to save	anonymous	Jpm	"see:

https://www.autoitscript.com/forum/topic/212753-richedit-streamtofile-adds-newline-every-time/

example code + temp solution:


{{{
#include <GUIConstants.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Opt(""MustDeclareVars"", True)

;~ $__g_pGRC_StreamToFileCallback = DllCallbackRegister(""__GCR_StreamToFileCallbackEx"", ""dword"", ""long_ptr;ptr;long;ptr"")

Example()

Func Example()
  Local $hGui = GUICreate(""Example ("" & StringTrimRight(@ScriptName, StringLen("".exe"")) & "")"", 320, 350, -1, -1)
  Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, ""This is a test."", 10, 10, 300, 220, _
      BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
  Local $idBtnIn = GUICtrlCreateButton(""In"", 270, 310, 40, 30)
  Local $idBtnOut = GUICtrlCreateButton(""Out"", 170, 310, 40, 30)
  GUISetState(@SW_SHOW)

  _GUICtrlRichEdit_SetText($hRichEdit, ""First paragraph"")
  While True
    Switch GUIGetMsg()
      Case $GUI_EVENT_CLOSE
        ExitLoop
      Case $idBtnOut
        _GUICtrlRichEdit_StreamToFile($hRichEdit, @DesktopDir & ""\gcre.rtf"")
      Case $idBtnIn
        _GUICtrlRichEdit_StreamFromFile($hRichEdit, @DesktopDir & ""\gcre.rtf"")
    EndSwitch
  WEnd
  _GUICtrlRichEdit_Destroy($hRichEdit)
EndFunc   ;==>Example
}}}
"	Bug	closed	3.3.17.0	Standard UDFs	3.3.14.0	None	Fixed	_GUICtrlRichEdit_StreamToFile	
