Ermittelt den Zoomlevel des Controls
#include <GuiRichEdit.au3>
_GUICtrlRichEdit_GetZoom ( $hWnd )
$hWnd | Handle des Controls |
Erfolg: | das Zoomlevel, in Prozent |
Fehler: | 0 und setzt das @error Flag auf ungleich null |
@error: | 700 - interner Fehler |
- - - - - - - - Erklärung der Controls - - - - - - - -
Suche nach EM_GETZOOM in der MSDN Bibliothek.
#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
Global $g_idLblMsg
Example()
Func Example()
Local $hGui = GUICreate("RichEdit: Setzt udn ermittelt den Zoom (v" & @AutoItVersion & ")", 460, 350, -1, -1)
Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 340, 220, _
BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
$g_idLblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60)
Local $idBtnNext = GUICtrlCreateButton("Weiter", 270, 310, 40, 30)
GUISetState(@SW_SHOW)
_GUICtrlRichEdit_AppendText($hRichEdit, @CR & "Dies ist angehängter Text.")
Local $iMsg, $iStep = 0
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
_GUICtrlRichEdit_Destroy($hRichEdit) ; wird benötigt, da sonst das Skript abstürzt
;~ GUIDelete() ; ist auch in Ordnung
Exit
Case $iMsg = $idBtnNext
$iStep += 1
Switch $iStep
Case 1
Report("1.Zoom gesetzt auf " & _GUICtrlRichEdit_GetZoom($hRichEdit) & "%")
Case 2
_GUICtrlRichEdit_SetZoom($hRichEdit, 250)
Report("2.Zoom gesetzt auf " & _GUICtrlRichEdit_GetZoom($hRichEdit) & "%")
GUICtrlSetState($idBtnNext, $GUI_DISABLE)
EndSwitch
EndSelect
WEnd
EndFunc ;==>Example
Func Report($sMsg)
GUICtrlSetData($g_idLblMsg, $sMsg)
EndFunc ;==>Report