﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1803	GuiRichEdit Zoom Set	luc.leveque@…	Gary	"_GUICtrlRichEdit_GetZoom

; Remarks .......: MSDN claims that EM_SETZOOM works from 1.56% (1/64) to 6400$ (64/1) but testing shows that
;                  it only works reliably for the values shown above

'''FALSE'''

I send you my proposal for changing the function _GUICtrlRichEdit_GetZoom with an example, who works fine on my computer(values between 2 to 6399). with the code hereafter you can reduce zoom under 100% :

==
#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $lblMsg, $hRichEdit

Main()

Func Main()
	Local $hGui, $iMsg, $btnNext, $iStep = 0
	$hGui = GUICreate(""Example ("" & StringTrimRight(@ScriptName,4) &"")"", 320, 350, -1, -1)
	

	$hRichEdit = _GUICtrlRichEdit_Create($hGui, ""This is a test."", 10, 20, 300, 190, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
	$slider = GUICtrlCreateSlider(55, 245, 260, 30)	
	$lblZoom = GUICtrlCreateLabel(""Zoom 100%"", 10, 245, 40, 30)
	
	;Zoom
	$iZoomFocal = 5 ; possible value between 1, 63.99 : Msoffice value is 4
	$iZoomCurrent = 100	;percent Default Value
	$iZoomScaleMax = int($iZoomCurrent * $iZoomFocal);percent
	$iZoomScaleMin = 10 ;percent

	GUICtrlSetLimit ($slider, $iZoomScaleMax, $iZoomScaleMin)
	GUICtrlSetData($slider,$iZoomCurrent)
	
	GUISetState()

	Do
		$msg = GUIGetMsg()
		
		If $msg = $slider Then

			$iZoomCurrent = GUICtrlRead($slider)

			GUICtrlRichEdit_SetZoom($hRichEdit, $iZoomCurrent)
	
			GUICtrlSetData($lblZoom, ""Zoom : "" & $iZoomCurrent & "" %""  )

		EndIf
	Until $msg = $GUI_EVENT_CLOSE
	
EndFunc   ;==>Main

Func Report($sMsg)
	GUICtrlSetData($lblMsg, $sMsg)
EndFunc   ;==>Report

;
;PROPOSAL
;
Func GUICtrlRichEdit_SetZoom($hWnd, $iPercent)
	
	If Not IsHWnd($hWnd) Then Return SetError(101, 0, False)
	If Not __GCR_IsNumeric($iPercent, "">1"") Then Return SetError(1021, 0, False)
	If Not __GCR_IsNumeric($iPercent, ""<6400"") Then Return SetError(1021, 0, False)
	
	Return _SendMessage($hWnd, $EM_SETZOOM, $iPercent, 100) <> 0
	
EndFunc   ;==>_GUICtrlRichEdit_SetZoom
 =="	Bug	closed		Standard UDFs	3.3.6.1	None	Rejected	GuiRichEdit Zoom Set	
