StMaSi

Richedit Control Options

14 posts in this topic

#1 ·  Posted

Two questions...

When presenting a form containing a richedit control, is there any way to make the displayed text, within said richedit control, non-selectable?

In addition, is there any way to hide the vertical line cursor, within said richedit control?

Thanx.

Share this post


Link to post
Share on other sites



#2 ·  Posted

StMaSi,

WinSetState($hRichEdit, "", @SW_DISABLE) should do both for you.

M23 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

Well, that does, in fact, disable the control, but the background now turns from white to grey and the text is greyed out as well. Is there a way to have the control disabled in this manner, but to restore the background and text color to what they were prior to disabling the control?

Share this post


Link to post
Share on other sites

#4 ·  Posted

StMaSi,

How about a mask like this:

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Global $hGUI, $hGUI_Mask

Example()

Func Example()
    Local $hRichEdit, $iMsg
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
    _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "This is more text")

    $cButton = GUICtrlCreateButton("Test", 10, 300, 80, 30)

    GUISetState(@SW_SHOW)

    $aGUI_Pos = WinGetPos($hGUI)
    $hGUI_Mask = GUICreate("Mask", 300, 220, 0, 0, BitOR($WS_POPUP, $WS_BORDER), 0, $hGUI)
    GUISetBkColor(0xCCCCFF) ; Just so you can see the GUI in the example
    WinMove($hGUI_Mask, "", $aGUI_Pos[0] + 10, $aGUI_Pos[1] + 35)
    GUISetState(@SW_SHOWNOACTIVATE, $hGUI_Mask)
    WinSetTrans($hGUI_Mask, "", 100)

    ; Look for the main GUI moving
    GUIRegisterMsg($WM_MOVE, "_WM_MOVE")

    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
                ; GUIDelete()   ; is OK too
                Exit
            Case $iMsg = $cButton
                ConsoleWrite("Hit" & @CRLF)
        EndSelect

        If _WinAPI_GetFocus() = $hRichEdit Then
            _WinAPI_SetFocus($hGUI_Mask)
        EndIf

    WEnd

EndFunc   ;==>Example

Func _WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
    ; If the main GUI moves
    If $hWnd = $hGUI Then
        ; Move the child to follow
        Local $aGUI_Pos = WinGetPos($hWnd)
        WinMove($hGUI_Mask, "", $aGUI_Pos[0] + 10, $aGUI_Pos[1] + 35)
    EndIf
EndFunc   ;==>_WM_MOVE

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

Unfortunately, that hides my entire form.

Share this post


Link to post
Share on other sites

#6 ·  Posted

StMaSi,

No it does not, it only masks the RichEdit control - if it does more than that then you have messed up the sizing code. Please post what you are using and I will take a look.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

Okay. Here's my code...

#include <Date.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <GuiMenu.au3>
#include <GuiRichEdit.au3>
#include <MenuConstants.au3>
#include <Timers.au3>
#include <WindowsConstants.au3>

AutoItSetOption("TrayIconHide", 1)
AutoItSetOption("WinDetectHiddenText", 1)
AutoItSetOption("WinSearchChildren", 1)
AutoItSetOption("WinTitleMatchMode", -2)

Local $COUNTDOWN1 = IniRead(@ScriptDir & "\welcome.ini", "Parameters", "DelayTime", 10)
Local $TIMER1 = $COUNTDOWN1
Local $WINDOWS_ONTOP = 1

HotKeySet("!{F4}", "_HawkingHole")

GUISetIcon(@ScriptDir & "\welcome.ico", -1)
$RICHTEXTFILE1 = FileRead(@ScriptDir & "\welcome.rtf")
$FORM1 = GUICreate("Welcome", 600, 400, -1, -1, $WS_EX_TOPMOST, $WM_SYSCOMMAND + $WS_EX_WINDOWEDGE)
$PICTURE1 = GUICtrlCreatePic(@ScriptDir & "\welcome.bkg.jpg", 0, 0, 594, 371)
GUICtrlSetState(-1, $GUI_DISABLE)
$PICTURE2 = GUICtrlCreatePic(@ScriptDir & "\welcome.bnr.jpg", 2, 2, 157, 331)
GUICtrlSetState(-1, $GUI_DISABLE)
$PROGRESS1 = GUICtrlCreateProgress(230, 348, 170, 10)
$LABEL1 = GUICtrlCreateLabel("* Welcome", 10, 345, 190, 25)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$BUTTON1 = GUICtrlCreateButton("Upgrade", 433, 340, 75, 25)
$BUTTON2 = GUICtrlCreateButton("Defer", 513, 340, 75, 25)
$RICHEDITCONTROL1 = _GUICtrlRichEdit_Create($FORM1, $RICHTEXTFILE1, 175, 1, 415, 185, BitOR($ES_LEFT, $ES_MULTILINE, $ES_WANTRETURN, $ES_READONLY), 0)
_GUICtrlRichEdit_SetText($RICHEDITCONTROL1, $RICHTEXTFILE1)
_GUICtrlEdit_SetSel($RICHEDITCONTROL1, 600, 600)
WinSetState($RICHEDITCONTROL1, "", @SW_DISABLE)
GUIRegisterMsg($WM_SYSCOMMAND, "On_WM_SYSCOMMAND")
DisableButton($FORM1, $SC_CLOSE)
DisableButton($FORM1, $SC_MAXIMIZE)
DisableButton($FORM1, $SC_MINIMIZE)
DisableButton($FORM1, $SC_MOVE)
DisableButton($FORM1, $SC_RESTORE)
DisableButton($FORM1, $SC_SIZE)
_Timer_SetTimer($FORM1, 1000, '_Countdown')
GUISetState(@SW_SHOW)
OnTop()

While 1
    $IMSG = GUIGetMsg()
    Switch $IMSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $BUTTON1
            $UDATE = _NowCalcDate()
            $UTIME = _NowTime(5)
            $USTRING = @ComputerName & ", " & $UDATE & ", " & $UTIME
            $UFILENAME = "results.txt"
            $UFILEPATH = FileOpen(@ScriptDir & '\_log\' & $UFILENAME, 9)
            FileWrite($UFILEPATH, $USTRING & ", Upgraded" & @CRLF)
            FileClose($UFILEPATH)
            ;GUISetState(@SW_HIDE)
            Run(@ScriptDir & "\02.upgrade.exe")
            ;Exit
        Case $BUTTON2
            $DDATE = _NowCalcDate()
            $DTIME = _NowTime(5)
            $DSTRING = @ComputerName & ", " & $DDATE & ", " & $DTIME
            $DFILENAME = "results.txt"
            $DFILEPATH = FileOpen(@ScriptDir & '\_log\' & $DFILENAME, 9)
            FileWrite($DFILEPATH, $DSTRING & ", Deferred" & @CRLF)
            FileClose($DFILEPATH)
            ;GUISetState(@SW_HIDE)
            Run(@ScriptDir & "\03.defer.exe")
            ;Exit
    EndSwitch
WEnd

Func _HawkingHole()
    ; Disable ALT+F4 key combination
EndFunc   ;==>_HawkingHole

Func On_WM_SYSCOMMAND($FORM1, $MESSAGE1, $WPARAM, $LPARAM)
    If BitAND($WPARAM, 0xFFF0) = $SC_MOVE Then Return False
    Return $GUI_RUNDEFMSG
EndFunc   ;==>On_WM_SYSCOMMAND

Func DisableButton($FORM1, $IBUTTON)
    $HSYSMENU = _GUICtrlMenu_GetSystemMenu($FORM1, 0)
    _GUICtrlMenu_RemoveMenu($HSYSMENU, $IBUTTON, False)
    _GUICtrlMenu_DrawMenuBar($FORM1)
EndFunc   ;==>DisableButton

Func _Countdown($FORM1, $IMSG, $IIDTIMER, $DWTIME)
    $COUNTDOWN1 -= 1
    $PERCENT_VALUE = Floor(($COUNTDOWN1 / $TIMER1) * 100)
    $PERCENT_VALUE = 100 - $PERCENT_VALUE
    If $COUNTDOWN1 > 0 Then
        GUICtrlSetData($PROGRESS1, $PERCENT_VALUE)
    ElseIf $COUNTDOWN1 = 0 Then
        GUICtrlSetData($PROGRESS1, $PERCENT_VALUE)
        _Timer_KillTimer($FORM1, $IIDTIMER)
        ControlClick($FORM1, '', $BUTTON1)
    EndIf
EndFunc   ;==>_Countdown

Func _SecsToTime($ITICKS)
    Local $IHOURS, $IMINUTES, $ISECONDS
    _TicksToTime($ITICKS * 1000, $IHOURS, $IMINUTES, $ISECONDS)
    Return StringFormat("%2i:%02i", $IMINUTES, $ISECONDS)
EndFunc   ;==>_SecsToTime

Func OnTop()
    Global $DISPLAY = WinGetHandle($FORM1)
    WinSetOnTop($DISPLAY, "", $WINDOWS_ONTOP)
EndFunc   ;==>OnTop

When I add the...

WinSetState($RICHEDITCONTROL1, "", @SW_DISABLE)

The richedit control is greyed out. However, when I attempted to incorporate your mask code, the entire form would not display. Like you said, I must be attempting to incorporate your code improperly (it's not currently within this code). Can you assist with the incorporation?

Thanx.

Share this post


Link to post
Share on other sites

#8 ·  Posted

Here's something a little simpler. I used this when I was working on a console application and wanted to use a rich edit

Creating a label over the area where the richedit control is and setting the label's backcolor to $GUI_BKCOLOR_TRANSPARENT

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Global $hGUI

Example()

Func Example()
    Local $hRichEdit, $iMsg
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1)
    $lblMask = GUICtrlCreateLabel("", 10, 10, 300, 220)
    GUICtrlSetBkColor($lblMask, $GUI_BKCOLOR_TRANSPARENT)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
    _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "This is more text")
    ; Prevent the richedit from being entered using the 'Tab' key
    _WinAPI_SetWindowLong($hRichEdit, $GWL_STYLE, BitAND(_WinAPI_GetWindowLong($hRichEdit, $GWL_STYLE), BitNOT($WS_TABSTOP)))

    $cButton = GUICtrlCreateButton("Test", 10, 300, 80, 30)
    ; Set the button to focus so the richedit control doesn't have focus (having focus would let someone type in it)
    GUICtrlSetState($cButton, $GUI_FOCUS)

    GUISetState(@SW_SHOW)

    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes
                ; GUIDelete()   ; is OK too
                Exit
            Case $iMsg = $cButton
                ConsoleWrite("Hit" & @CRLF)
        EndSelect
    WEnd

EndFunc   ;==>Example

 

Share this post


Link to post
Share on other sites

#9 ·  Posted

InunoTaishou,

Great idea and much simpler than mine. I think I became fixated on using a child GUI because I had been working on one earlier on the day.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

When utilizing the following two bits of code from InunoTaishou, the richedit control remains active (not greyed out) and the cursor is not flashing because the focus is on the label:

...
_WinAPI_SetWindowLong($RICHEDITCONTROL1, $GWL_STYLE, BitAND(_WinAPI_GetWindowLong($RICHEDITCONTROL1, $GWL_STYLE), BitNOT($WS_TABSTOP)))
...
GUICtrlSetState($LABEL1, $GUI_FOCUS)
...

However, the richedit control is still selectable...a user can click into it, which exposes the cursor and/or double-click into it and highlight text within. Short of utilizing individual labels for the information that would be contained within one richedit control, is there no other way to "lock down" (for lack of a better term) the richedit control, but avoid disabling it (the graying out)?

Thanx again for all your help, peeps.

Share this post


Link to post
Share on other sites

#11 ·  Posted

StMaSi,

Quote

However, the richedit control is still selectable...a user can click into it, which exposes the cursor and/or double-click into it and highlight text within

Really? I have just been trying to do just that and I cannot get at the RichEdit at all. How did you manage it?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

Perhaps my mouse-clicking is more powerful than yours?

 

B)

Share this post


Link to post
Share on other sites

#13 ·  Posted

Create the RichEdit in a child window and disable the child window:

Create the RichEdit in a child window and disable the child window:

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
  $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName, StringLen(".exe")) & ")", 320, 350, -1, -1)

  $hChild = GUICreate( "", 300, 220, 10, 10, $WS_CHILD, -1, $hGui )
  GUISetState( @SW_DISABLE )
  GUISetState()

  $hRichEdit = _GUICtrlRichEdit_Create($hChild, "This is a test.", 0, 0, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
  _GUICtrlRichEdit_AppendText($hRichEdit, @CRLF & "This is more text")

  GUISwitch( $hGui )
  GUISetState()

  While GUIGetMsg() <> $GUI_EVENT_CLOSE
  WEnd
EndFunc

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

I'm going to guess and say that the label you created over the richedit control is not actually over the richedit control. So you're just clicking on the richedit.

Do this and see where your label is actually at

GUICtrlSetBkColor($LABEL1, 0xFF0000)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • natedog102
      By natedog102
      This small UDF helps you save any text to speech to a .wav file. 
      UDF:
      #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #INDEX# ======================================================================================================================= ; Title .........: _TTStoWav() ; AutoIt Version : 3.3.14.2 ; Language ......: English ; Author(s) .....: natedog102 ; Modifiers .....: ; Forum link ....: https://www.autoitscript.com/forum/topic/191573-tts-text-to-speech-to-wav-file-using-sapi/ ; Description ...: TTS to .wav file using SAPI ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _TTStoWav ; Description ...: TTS to .wav file using SAPI ; Syntax.........: _TTStoWav($sText, $sLocation[, $iRate = 1[, $iVolume = 100]]) ; Parameters ....: $sText - String you want converted to a .wav ; $sLocation - Save location + file name, example: "C:\folder\sample.wav" ; $iRate - TTS speak rate between -10 and 10 ; $iVolume - Volume of the TTS between 0 and 100 ; Return values .: Success - Returns one ; Failure - Returns zero ; Author ........: natedog102 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TTStoWav($sText, $sLocation, $iRate = 1, $iVolume = 100) $oFileStream = ObjCreate("SAPI.SpFileStream") If @error Then Return 0 EndIf $oFileStream.Format.Type = 39 $oFileStream.Open($sLocation, 3) $oSpeech = ObjCreate('SAPI.SpVoice') If @error Then Return 0 EndIf $oSpeech.AudioOutputStream = $oFileStream $oSpeech.Rate = $iRate $oSpeech.Volume = $iVolume $oSpeech.Speak($sText, 3) $oSpeech.WaitUntilDone(10000) $oFileStream.Close() Return 1 EndFunc ;==>_TTStoWav And here's example usage:
      _TTStoWav("This is a test", "C:\folder-must-exist\sample2.wav") I have never made a UDF before so I don't know if I coded it correctly or if I followed all the recommended guidelines. Apologies if I haven't.
      DOWNLOAD:
       _TTStoWav.au3
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
       
      Thanks
       
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
      my requirement is i have a window and i have to get the value present in that window (below is the picture)

      in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..

       
      CAN it be done?
       
      thanks

    • loganizzi
      By loganizzi
      If you look at the help file for the above command, you'll see that it states that it only works for certain zoom values (100 and 200 to 6400).   I assume that this is due to an issue in an MSDN library that the command relies on.
      After doing some investigating, I noticed that the GUIRichEdit.au3 library file contains the following code:
      ; #FUNCTION# ==================================================================================================================== ; Authors........: Chris Haslam (c.haslam) ; Modified ......: ; =============================================================================================================================== Func _GUICtrlRichEdit_SetZoom($hWnd, $iPercent) If Not _WinAPI_IsClassName($hWnd, $__g_sRTFClassName) Then Return SetError(101, 0, False) If Not __GCR_IsNumeric($iPercent, ">0") Then Return SetError(1021, 0, False) Local $iNumerator, $iDenominator Select Case Not ($iPercent = 100 Or ($iPercent >= 200 And $iPercent < 6400)) Return SetError(1022, 0, False) Case $iPercent >= 100 $iNumerator = 10000 $iDenominator = 10000 / ($iPercent / 100) Case Else $iNumerator = 10000 * ($iPercent / 100) $iDenominator = 10000 EndSelect Return _SendMessage($hWnd, $EM_SETZOOM, $iNumerator, $iDenominator) <> 0 EndFunc ;==>_GUICtrlRichEdit_SetZoom Which ensures that values are only within the bounds specified in the help file.    I found that if I comment out the portion of the code that limits the values, the function works fine for most (if not all) values.   I changed the code in the library file to this by simply commenting out the restricting lines of code:
      ; #FUNCTION# ==================================================================================================================== ; Authors........: Chris Haslam (c.haslam) ; Modified ......: ; =============================================================================================================================== Func _GUICtrlRichEdit_SetZoom($hWnd, $iPercent) If Not _WinAPI_IsClassName($hWnd, $__g_sRTFClassName) Then Return SetError(101, 0, False) If Not __GCR_IsNumeric($iPercent, ">0") Then Return SetError(1021, 0, False) Local $iNumerator, $iDenominator Select ; Case Not ($iPercent = 100 Or ($iPercent >= 200 And $iPercent < 6400)) ; Return SetError(1022, 0, False) Case $iPercent >= 100 $iNumerator = 10000 $iDenominator = 10000 / ($iPercent / 100) Case Else $iNumerator = 10000 * ($iPercent / 100) $iDenominator = 10000 EndSelect Return _SendMessage($hWnd, $EM_SETZOOM, $iNumerator, $iDenominator) <> 0 EndFunc ;==>_GUICtrlRichEdit_SetZoom  
      I assume whatever windows bug existed at the time this was created, no longer exists so there is no need to restrict the values.   
      Just wanted to point this out if anyone else is using this part of the library and required this functionality like I did.