Ich möchte das in einem Edit bestimmte Zeilen makiert werden, das klappt auch alles so wie ich möchte nur sobald das Fenster kein Fokus mehr hat sieht man die Makierung nicht mehr, weiß jemand eine Lösung?
AutoIt
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
Example()
Func Example()
Local $hStatusBar, $idEdit, $hGUI
Local $sWow64 = ""
If @AutoItX64 Then $sWow64 = "\Wow6432Node"
Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\include\_ReadMe_.txt"
Local $aPartRightSide[3] = [190, 378, -1], $aSel
; Create GUI
$hGUI = GUICreate("Edit Set Sel", 400, 300)
$idEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
$hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aPartRightSide)
_GUICtrlStatusBar_SetIcon($hStatusBar, 2, 97, "shell32.dll")
GUISetState(@SW_SHOW)
; Set Margins
_GUICtrlEdit_SetMargins($idEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 10, 10)
; Set Text
$data=""
For $i = 10 To 50
$data &= $i & ": 12345" & @CRLF
Next
_GUICtrlEdit_SetText($idEdit, $data)
$i_size = 0
For $i = 10 To 50
$i_size += 11
_GUICtrlEdit_LineScroll($idEdit, 1,1)
_GUICtrlEdit_SetSel($idEdit, $i_size, $i_size+10)
Sleep(500)
Next
; Get Sel
$aSel = _GUICtrlEdit_GetSel($idEdit)
_GUICtrlStatusBar_SetText($hStatusBar, "Start: " & $aSel[0])
_GUICtrlStatusBar_SetText($hStatusBar, "End: " & $aSel[1], 1)
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
Alles anzeigen