| 1 | #include <EditConstants.au3> |
|---|
| 2 | #include <GUIConstantsEx.au3> |
|---|
| 3 | #include <GuiRichEdit.au3> |
|---|
| 4 | #include <WindowsConstants.au3> |
|---|
| 5 | |
|---|
| 6 | Opt("GUIOnEventMode", 1) |
|---|
| 7 | |
|---|
| 8 | OnAutoItExitRegister("Exit_RichEdit") |
|---|
| 9 | |
|---|
| 10 | Global $Gui |
|---|
| 11 | Global $RichEdit[3] |
|---|
| 12 | |
|---|
| 13 | $Gui = GUICreate("Exemple", 300, 300) |
|---|
| 14 | GUISetBkColor(0xFF0000, $Gui) |
|---|
| 15 | GUISetOnEvent($GUI_EVENT_CLOSE, "quit") |
|---|
| 16 | $RichEdit[0] = _GUICtrlRichEdit_Create($Gui, "", 0, 0, 300, 90, BitOR($ES_MULTILINE, $WS_VSCROLL)) |
|---|
| 17 | $RichEdit[1] = _GUICtrlRichEdit_Create($Gui, "", 0, 100, 300, 90, BitOR($ES_MULTILINE, $WS_VSCROLL)) |
|---|
| 18 | $RichEdit[2] = _GUICtrlRichEdit_Create($Gui, "", -10, 200, 302, 90, BitOR($ES_MULTILINE, $WS_VSCROLL)) |
|---|
| 19 | GUISetState() |
|---|
| 20 | |
|---|
| 21 | While(True) |
|---|
| 22 | Sleep(10) |
|---|
| 23 | WEnd |
|---|
| 24 | |
|---|
| 25 | Func Exit_RichEdit() |
|---|
| 26 | For $i = 0 To UBound($RichEdit, 1)-1 |
|---|
| 27 | If($RichEdit[$i] > 0) Then |
|---|
| 28 | _GUICtrlRichEdit_Destroy($RichEdit[$i]) |
|---|
| 29 | EndIf |
|---|
| 30 | Next |
|---|
| 31 | EndFunc |
|---|
| 32 | |
|---|
| 33 | Func quit() |
|---|
| 34 | Exit |
|---|
| 35 | EndFunc |
|---|