1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. BugFix

Beiträge von BugFix

  • Prozeßvergleich

    • BugFix
    • 8. März 2009 um 20:03
    Zitat von blubbstar

    Läuft das eigentlich auch auf Vista?


    Kann ich nicht sicher sagen, bin bekennender Vista-Verweigerer. :rolleyes:

  • Prozeßvergleich

    • BugFix
    • 8. März 2009 um 14:45

    Hi,
    im Hilfeforum tauchte die Frage auf, wie man feststellen kann, ob ein neuer Prozeß hinzugekommen ist.
    Ich hab das mal in ein Bsp. verpackt. Hier wird es mit HotKey (WIN+ALT+P) aufgerufen. Läßt sich im Skript zum Bsp. mit AdlibEnable einbinden.

    Spoiler anzeigen
    [autoit]

    Global $oList_old = ObjCreate("Scripting.Dictionary")
    Global $oList_cur = ObjCreate("Scripting.Dictionary")
    Global $oList_new = ObjCreate("Scripting.Dictionary")
    Global $aProcess

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet('#!p', '_showP')
    HotKeySet('#!e', '_ende')

    [/autoit] [autoit][/autoit] [autoit]

    While True
    Sleep(50)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _showP()
    Local $ar = _GetNewProcess(), $str = ''
    If $ar[0][0] = -1 Then Return MsgBox(0, 'Neue Prozesse', 'Keine neuen Prozesse.')
    For $i = 0 To UBound($ar) -1
    $str &= $ar[$i][1] & @TAB & $ar[$i][0] & @CRLF
    Next
    Return MsgBox(0, 'Neue Prozesse', $str)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _ende()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _GetNewProcess()
    $aProcess = ProcessList()
    For $i = 1 To UBound($aProcess) -1
    $oList_cur.Add($aProcess[$i][1], $aProcess[$i][0])
    Next
    If $oList_old.Count <> 0 Then
    If $oList_new.Count > 0 Then $oList_new.RemoveAll
    For $process In $oList_cur.Keys
    If Not $oList_old.Exists($process) Then $oList_new.Add($process, $oList_cur.Item($process))
    Next
    $oList_old.RemoveAll
    Else
    _CopyList($oList_cur, $oList_new)
    EndIf
    _CopyList($oList_cur, $oList_old)
    $oList_cur.RemoveAll
    Local $aOut[1][2] = [[-1]], $i = 0
    If $oList_new.Count > 0 Then
    ReDim $aOut[$oList_new.Count][2]
    For $process In $oList_new.Keys
    $aOut[$i][0] = $oList_new.Item($process)
    $aOut[$i][1] = $process
    $i += 1
    Next
    EndIf
    Return $aOut
    EndFunc ;==>_GetNewProcess

    [/autoit] [autoit][/autoit] [autoit]

    Func _CopyList(ByRef $oDictFrom, ByRef $oDictTo)
    For $key In $oDictFrom.Keys
    $oDictTo.Add($key, $oDictFrom.Item($key))
    Next
    EndFunc

    [/autoit]
  • Neue Prozesse Suchen

    • BugFix
    • 8. März 2009 um 12:55
    Zitat von pceumel

    Hab ich ja gemacht aber er machts nicht richtig,er liest immer alle aus!


    Das ist ja korrekt. Diese vergleichst du dann mit den protokollierten. Unterschiede sind dann die neuen Prozesse.

    Edit: Ich hab mal ein Bsp. erstellt, findest du hier: Prozeßvergleich

  • IntelliSenseBox

    • BugFix
    • 8. März 2009 um 12:17

    Ja, das hab ich oben in meinem Edit geschrieben ;)
    Die Ctrl-Erkennung erfolgt automatisch.
    Hier mal ein Bsp. (Code ist identisch, bis auf die Region Main also deine GUI mit Control):

    Spoiler anzeigen
    [autoit]

    #Include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #Include <GuiListBox.au3>
    #include <GUIComboBox.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #region - Deklarationen für Sense
    Global $show = False
    Global $indexB = -1
    Global $SenseGui, $SenseCtrl, $guiBox, $box
    Global $POSSenseGui[2]
    #Region Box
    ; Hier die Auswahldaten (braucht nicht sortiert sein):
    Global $aData = StringSplit("Ananas|Apfel|Apfelmus|Birne|Cola|Datteln|Eis|Fleisch|Gemüse|Hefe|Ingwer|Joghurt|Kaffee|Lachs|Mais|Nuss|Nutella|Obst|Pizza|Quark|Reis|Salz|Tee|U|Vanillezucker|Wasser|X|Y|Zucker", '|')
    $guiBox = GUICreate('', 150, 85, 0, 0, BitOR($WS_SIZEBOX,$WS_POPUP), $WS_EX_TOPMOST)
    $box = _GUICtrlListBox_Create($guiBox, '', 0, 0, 150, 86, BitOR($LBS_SORT, 0x00B00002))
    ; ListBox muß 1 Pixel höher als GUI sein - sonst fehlerhafte Darstellung
    For $i = 1 To UBound($aData) -1 ; falls Daten mit _FileReadToArray gelesen werden: StartIndex=1
    _GUICtrlListBox_AddString($box, $aData[$i])
    Next
    #EndRegion Box
    GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
    GUIRegisterMsg($WM_MOVE, "_WM_MOVE")
    GUIRegisterMsg(0x231, "_WM_ENTERSIZEMOVE")
    #EndRegion - Deklarationen Sense

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #Region Main
    $gui = GuiCreate("Main Gui", 300,300)
    $Combo = GuiCtrlCreateCombo("Einkaufsliste...", 35, 150, -1, -1, BitOR($CBS_DROPDOWN,$WS_VSCROLL,$WS_TABSTOP))
    $BUtton = GuiCtrlCreateButton("OK", 240,148)
    $SenseGui = $gui ; <== Für Allgemeingültigkeit Zuweisung an $SenseGui
    $SenseCtrl = $Combo ; <== Für Allgemeingültigkeit Zuweisung an $SenseCtrl
    GUISetState()
    #EndRegion Main

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While True
    _ChooseBox()
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #region - SenseFunc's
    Func _ChooseBox()
    If Not $show Then Return
    If _IsPressed('0D') Then ; ENTER
    ControlSetText($SenseGui, '', $SenseCtrl, _GUICtrlListBox_GetText($box, $indexB))
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf _IsPressed('1B') Then ; ESC
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf _IsPressed('26') Then ; UP
    If $indexB > 0 Then
    $indexB -= 1
    _GUICtrlListBox_SetCurSel($box, $indexB)
    Sleep(90)
    EndIf
    ElseIf _IsPressed('28') Then ; DOWN
    If $indexB < _GUICtrlListBox_GetCount($box)-1 Then
    $indexB += 1
    _GUICtrlListBox_SetCurSel($box, $indexB)
    Sleep(90)
    EndIf
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $hCtrl = $lParam
    Local $hSenseCtrl = $SenseCtrl
    If Not IsHWnd($hSenseCtrl) Then $hSenseCtrl = GUICtrlGetHandle($hSenseCtrl)
    If ($nNotifyCode = 1024 Or $nNotifyCode = 6) And $hCtrl = $hSenseCtrl Then
    Local $str = ControlGetText($SenseGui, '', $SenseCtrl)
    $indexB = _GUICtrlListBox_FindString($box, $str)
    _GUICtrlListBox_SetCurSel($box, $indexB)
    $caret = _CaretPos()
    If Not @error And Not $show Then
    If $caret[3] + $caret[4] - 95 < 0 Then ; Platz für Liste über dem Ctrl ausreichend?
    WinMove($guiBox, '', $caret[0], $caret[1] +25) ; Versatz 25 (Ctrlhöhe+5) unter y vom Ctrl
    Else
    WinMove($guiBox, '', $caret[0], $caret[1] -95) ; Versatz 95 (Boxhöhe+10) über y vom Ctrl
    EndIf
    GUISetState(@SW_SHOWNOACTIVATE, $guiBox)
    $show = True
    EndIf
    ElseIf $hCtrl = $box And $nNotifyCode = 1 Then
    $indexB = _GUICtrlListBox_GetCurSel($box)
    ControlSetText($SenseGui, '', $SenseCtrl, _GUICtrlListBox_GetText($box, $indexB))
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf $show And $nNotifyCode = 512 And $hCtrl = $lParam And Not $hCtrl = $box Then
    GUISetState(@SW_HIDE,$guiBox)
    $show = False
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_ENTERSIZEMOVE($hWnd)
    If $hWnd = $SenseGui Then $POSSenseGui = WinGetPos($SenseGui)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_MOVE($hWnd)
    If $hWnd = $SenseGui Then
    Local $pos = WinGetPos($guiBox)
    Local $postemp = WinGetPos($SenseGui)
    WinMove($guiBox,"",$pos[0]-($POSSenseGui[0]-$postemp[0]),$pos[1]-($POSSenseGui[1]-$postemp[1]))
    $POSSenseGui = WinGetPos($SenseGui)
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _CaretPos()
    Local $old = Opt("CaretCoordMode", 0) ;relative mode
    Local $c = WinGetCaretPos() ;relative caret coords
    Local $w = WinGetPos("") ;window's coords
    Local $f = ControlGetFocus("","") ;text region "handle"
    Local $e = ControlGetPos("", "", $f) ;text region coords
    Local $h = ControlGetHandle("", "", $f) ;Ctrl-Handle
    Local $t[5]
    If IsArray($c) and IsArray($w) and IsArray($e) Then
    If _WinAPI_IsClassName($SenseCtrl, 'Edit') Then ; Input wird als Edit-Class erkannt
    $t[0] = $c[0] + $w[0] + $e[0]
    ElseIf _WinAPI_IsClassName($SenseCtrl, 'ComboBox') Then
    $t[0] = $w[0] + $e[0]
    EndIf
    $t[1] = $c[1] + $w[1] + $e[1]
    $t[2] = $h
    $t[3] = $w[1]
    $t[4] = $e[1]
    Opt("CaretCoordMode", $old)
    Return $t ;absolute screen coords of caret cursor
    Else
    Opt("CaretCoordMode", $old)
    SetError(1)
    EndIf
    EndFunc
    #endregion - SenseFunc's

    [/autoit]
  • Minimierte versteckte Fenster Pixel Auslesen, Send etc.

    • BugFix
    • 8. März 2009 um 12:12
    Zitat von NonStop

    Ich bräuchte:
    MouseClick <== Fenster im Hintergrund hat keine Mausposition - also nicht möglich
    Send <== ControlSend()
    und
    PixelGetColor <== wie bei Maus, was du nicht siehst, kannst du nicht erkennen


    Und bevor du weiterschreibst, wirf einen Blick in die Forenregeln, ob das, was du tun willst evtl. dagegen verstößt.

  • Edit mit Guictrlsetdata und autoscroll

    • BugFix
    • 8. März 2009 um 12:06

    Das kannst du so lösen:

    [autoit]

    #include <GUIConstants.au3>
    #Include <GuiEdit.au3>
    Opt("GUIOnEventMode", 1)

    [/autoit][autoit][/autoit][autoit]

    $Gui = GUICreate('test')
    GUISetOnEvent($GUI_EVENT_CLOSE, '_end')
    $Edit = GUICtrlCreateEdit('', 10, 10, 300, 150)
    $hEdit = GUICtrlGetHandle($Edit)
    GUISetState()

    [/autoit][autoit][/autoit][autoit]

    $data = ''
    For $i = 1 To 20
    $data &= 'Das ist Zeile Nummer ' & $i & @CRLF
    Next
    GUICtrlSetData($Edit, $data)
    ; jetzt zur letzten Zeile scrollen
    _GUICtrlEdit_LineScroll($hEdit, 0, _GUICtrlEdit_GetLineCount($hEdit))

    [/autoit][autoit][/autoit][autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit][autoit][/autoit][autoit]

    Func _end()
    Exit
    EndFunc

    [/autoit]
  • InetGet bei Uploaded.to

    • BugFix
    • 8. März 2009 um 11:34

    Immer dasselbe: Wie sollen wir erahnen, wo ein Fehler liegt, wenn du uns keine Code zeigst?

  • IntelliSenseBox

    • BugFix
    • 8. März 2009 um 11:19

    Überarbeitete Version in Post 1.

  • Festplatte durchsuchen

    • BugFix
    • 7. März 2009 um 23:46

    Bemühe mal die Suche mit "Rekursive Dateisuche"
    Na gut, ich weiß ja wo es steht: Rekursive Dateisuche per Objekt

  • Verlinken

    • BugFix
    • 7. März 2009 um 19:05

    Für Hyperlinks verwende doch dieses: http://www.autoitscript.com/forum/index.php?showtopic=21121&view=findpost&p=145902
    oder
    http://www.autoitscript.com/forum/index.php?showtopic=23111&view=findpost&p=161225

  • Einfache Frage

    • BugFix
    • 7. März 2009 um 18:56

    Wie wär es, wenn du mal versuchst die Hilfe zu nutzen. Schau z.B. bei "GUICtrlCreateButton" - dort findest du ein kpl. Bsp.

  • GuiRegisterMsg + Combobox = Stress -.-

    • BugFix
    • 7. März 2009 um 18:50

    Also ich hoffe mal, ich habs jetzt richtig verstanden.
    - Du hast eine Liste mit Einträgen
    - Die Liste der ComboBox ist leer
    - Wenn du einen Buchstaben (Folgebuchstaben) in das Editfeld der ComboBox schreibst, sollen Begriffe aus deiner vorgefertigten Liste, wo Übereinstimmung besteht, zur Auswahl gezeigt werden
    - Ausgewählte Einträge werden mit OK-Button übernommen und in die ListBox eingetragen

    Auf dieser Basis habe ich das mal erstellt:

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    #Include <GuiListBox.au3>
    #include <GUIComboBox.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $show = False
    Global $index = -1
    Global $POSForm1[2]

    [/autoit] [autoit][/autoit] [autoit]

    $gui = GuiCreate("Main Gui", 300,300)
    $Combo = GuiCtrlCreateCombo("Einkaufsliste...", 35, 150, -1, -1, BitOR($CBS_DROPDOWN,$WS_VSCROLL,$WS_TABSTOP))
    $BUtton = GuiCtrlCreateButton("OK", 240,148)
    GuiSetState()

    [/autoit] [autoit][/autoit] [autoit]

    Global $aData = StringSplit("Ananas|Apfel|Apfelmus|Birne|Cola|Datteln|Eis|Fleisch|Gemüse|Hefe|Ingwer|Joghurt|Kaffee|Lachs|Mais|Nuss|Nutella|Obst|Pizza|Quark|Reis|Salz|Tee|U|Vanillezucker|Wasser|X|Y|Zucker", '|')
    $guiBox = GUICreate('', 150, 85, 0, 0, BitOR($WS_SIZEBOX,$WS_POPUP), $WS_EX_TOPMOST)
    $box = _GUICtrlListBox_Create($guiBox, '', 0, 0, 150, 86, BitOR($LBS_SORT, 0x00B00002))
    For $i = 1 To UBound($aData) -1
    _GUICtrlListBox_AddString($box, $aData[$i])
    Next

    [/autoit] [autoit][/autoit] [autoit]

    GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
    GUIRegisterMsg($WM_MOVE,"_WM_MOVE")
    GUIRegisterMsg(0x231,"_WM_ENTERSIZEMOVE")

    [/autoit] [autoit][/autoit] [autoit]

    While True
    If $show Then
    If _IsPressed('0D') Then
    ControlSetText($gui, '', $Combo, _GUICtrlListBox_GetText($box, $index))
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf _IsPressed('1B') Then
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf _IsPressed('26') Then
    If $index > 0 Then
    $index -= 1
    _GUICtrlListBox_SetCurSel($box, $index)
    Sleep(90)
    EndIf
    ElseIf _IsPressed('28') Then
    If $index < _GUICtrlListBox_GetCount($box)-1 Then
    $index += 1
    _GUICtrlListBox_SetCurSel($box, $index)
    Sleep(90)
    EndIf
    EndIf
    EndIf
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $BUtton
    _GUICtrlComboBox_AddString(GUICtrlGetHandle($Combo), ControlGetText($gui, '', GUICtrlGetHandle($Combo)))
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    $nNotifyCode = BitShift($wParam, 16)
    $hCtrl = $lParam
    Local $hCombo = $Combo
    If Not IsHWnd($hCombo) Then $hCombo = GUICtrlGetHandle($Combo)
    If $hCtrl = $hCombo And $nNotifyCode = 6 Then
    Local $str = ControlGetText($hWnd, '', $hCombo)
    $index = _GUICtrlListBox_FindString($box, $str)
    _GUICtrlListBox_SetCurSel($box, $index)
    $caret = _CaretPos()
    If Not @error And Not $show Then
    If $caret[3] + $caret[4] - 95 < 0 Then ; Platz für Liste über dem Ctrl ausreichend?
    WinMove($guiBox, '', $caret[0], $caret[1] +25) ; Versatz 25 (Ctrlhöhe+5) unter y vom Ctrl
    Else
    WinMove($guiBox, '', $caret[0], $caret[1] -95) ; Versatz 95 (Boxhöhe+10) über y vom Ctrl
    EndIf
    GUISetState(@SW_SHOWNOACTIVATE, $guiBox)
    $show = True
    EndIf
    ElseIf $hCtrl = $box And $nNotifyCode = 1 Then
    $index = _GUICtrlListBox_GetCurSel($box)
    ControlSetText($gui, '', $Combo, _GUICtrlListBox_GetText($box, $index))
    GUISetState(@SW_HIDE, $guiBox)
    $show = False
    ElseIf $show And $nNotifyCode = 512 And $hCtrl = $lParam And Not $hCtrl = $box Then
    GUISetState(@SW_HIDE,$guiBox)
    $show = False
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_ENTERSIZEMOVE($hWnd, $Msg, $wParam, $lParam)
    If $hWnd = $gui Then $POSForm1 = WinGetPos($gui)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _WM_MOVE($hWnd, $Msg, $wParam, $lParam)
    If $hWnd = $gui Then
    Local $pos = WinGetPos($guiBox)
    Local $postemp = WinGetPos($gui)
    WinMove($guiBox,"",$pos[0]-($POSForm1[0]-$postemp[0]),$pos[1]-($POSForm1[1]-$postemp[1]))
    $POSForm1 = WinGetPos($gui)
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _CaretPos()
    Local $old = Opt("CaretCoordMode", 0) ;relative mode
    Local $c = WinGetCaretPos() ;relative caret coords
    Local $w = WinGetPos("") ;window's coords
    Local $f = ControlGetFocus("","") ;text region "handle"
    Local $e = ControlGetPos("", "", $f) ;text region coords
    Local $h = ControlGetHandle("", "", $f) ;Ctrl-Handle
    Local $t[5]
    If IsArray($c) and IsArray($w) and IsArray($e) Then
    $t[0] = $w[0] + $e[0]
    $t[1] = $c[1] + $w[1] + $e[1]
    $t[2] = $h
    $t[3] = $w[1]
    $t[4] = $e[1]
    Opt("CaretCoordMode", $old)
    Return $t ;absolute screen coords of caret cursor
    Else
    Opt("CaretCoordMode", $old)
    SetError(1)
    EndIf
    EndFunc

    [/autoit]
  • GuiRegisterMsg + Combobox = Stress -.-

    • BugFix
    • 7. März 2009 um 14:38

    Das Stichwort ist: IntelliSense :D
    Habe ich schon mal gemacht: IntelliSenseBox

  • Prüfen ob ein Fenster im Vordergrund ist.

    • BugFix
    • 7. März 2009 um 14:30

    Wenn du das Fenster selbst nach vorn holst (per Mausklick) wird es aktiviert, das tust du in deinem Skriptbeispiel nicht.
    So klappt es:

    [autoit]

    ConsoleWrite(WinGetState("Arbeitsplatz","") & @CRLF)
    WinSetOnTop("Arbeitsplatz","",1)
    WinActivate("Arbeitsplatz","")
    ConsoleWrite(WinGetState("Arbeitsplatz","") & @CRLF)

    [/autoit]
  • Prüfen ob ein Fenster im Vordergrund ist.

    • BugFix
    • 7. März 2009 um 14:17

    Klar gehts mit WinGetState:

    [autoit]

    HotKeySet('#t', '_status')
    Global $aGui[3]
    $aGui[0] = GUICreate('1', -1, -1, 100, 100)
    $aGui[1] = GUICreate('2', -1, -1, 140, 140)
    $aGui[2] = GUICreate('3', -1, -1, 180, 180)
    GUISetState(@SW_SHOW, $aGui[2])
    GUISetState(@SW_SHOW, $aGui[1])
    GUISetState(@SW_SHOW, $aGui[0])

    [/autoit][autoit][/autoit][autoit]

    Do
    Until GUIGetMsg() = -3

    [/autoit][autoit][/autoit][autoit]

    Func _status()
    For $i = 0 To UBound($aGui) -1
    If WinGetState($aGui[$i]) = 15 Then MsgBox(0, 'Im Vordergrund', WinGetTitle($aGui[$i]))
    Next
    EndFunc

    [/autoit]

    Und WinActive tuts auch.

  • HEX-Code Farbtabelle

    • BugFix
    • 7. März 2009 um 13:56

    @Deathly Assassin:
    Auch wenn dein Post sicherlich sachlich richtig ist, ist es kein guter Stil, wenn man mit dem ersten Post, den man in einem neuen Forum erstellt, einen Beitrag hijackt um *klug-zu-scheissen*.
    Die von dir dargestellten Tatsachen sind ca. 99% der User dieses Forums sehr wohl bekannt. In einem Forum über Gartenbau wäre dieses vielleicht angebracht, da die Info für viele neu wär und somit auf fruchtbaren Boden fiele.

  • Bild als Programmhintergrund...

    • BugFix
    • 7. März 2009 um 13:48
    Zitat von team2way

    also pls einfach mal den quellcode posten so das es funktioniert - THX

    ?( - Vielleicht sollen wir dir auch noch ein paar Mandeltörtchen backen...
    Du bekommst hier die Tipps, baue sie in dein Skript ein, dann weißt du gleich wie es geht. Falls immer noch Probleme sind kannst du gerne nachfragen.

  • Dll

    • BugFix
    • 7. März 2009 um 11:21
    Zitat von Deepred

    Also funktioniert das mit AutoIt nicht?


    Nein, ist NET-Framework. :S

  • Listview Optik - Seltsames Verhalten

    • BugFix
    • 7. März 2009 um 00:26

    So kannst du den Fokus "entziehen", du übergibst ihn einfach an einen Dummy-Button von 1x1 pixel. Es geht nicht mit einem echten Dummy-Ctrl, da dieses wohl keinen Fokus annimmt.
    Aber falls außer dem Listview noch andere Ctrls vorhanden sind, kannst du ja irgendeinem anderen den Focus geben.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <StructureConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiListView.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $sHeader = "Aufgabe|Erstellt am|Termin"
    $Form = GUICreate("test", 633, 447, 193, 125)

    [/autoit] [autoit][/autoit] [autoit]

    $ListView = GUICtrlCreateListView($sHeader, 0, 0, 400, 300)
    $hListView = GUICtrlGetHandle($ListView)
    _GUICtrlListView_SetColumn($hListView, 0, "Column 1", 100, 0)
    _GUICtrlListView_SetColumn($hListView, 1, "Column 2", 100, 0)
    _GUICtrlListView_SetColumn($hListView, 2, "Column 3", 100, 0)
    For $i = 1 To 10
    _GUICtrlListView_AddItem($hListView, "Row" & $i & ": Col 1", $i-1)
    For $j = 1 To 2
    _GUICtrlListView_AddSubItem ($hListView, $i-1, "Row" & $i & ": Col " & $j+1, $j)
    Next
    Next

    [/autoit] [autoit][/autoit] [autoit]

    Global $dummy = GUICtrlCreateButton('', 0, 0, 1, 1)

    [/autoit] [autoit][/autoit] [autoit]

    ;Global $hDelAll = GUICtrlCreateButton("Test", 500, 300, 90, 35)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $form)
    GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY')

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView
    $hWndListView = $hListView
    If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    If HWnd(DllStructGetData($tNMHDR, "hWndFrom")) <> $hWndListView Then Return 0
    If DllStructGetData($tNMHDR, "Code") = $NM_CLICK Then
    Local $index = DllStructGetData(DllStructCreate($tagNMITEMACTIVATE, $ilParam), "Index")
    If $index = -1 Then GUICtrlSetState($dummy, $GUI_FOCUS)
    EndIf
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_NOTIFY

    [/autoit]
  • Sprung in Auswahl- Munue

    • BugFix
    • 5. März 2009 um 21:48

    :D Ich korrigiere mich: Nichts ist unmöglich.
    Schnuffel: Manchmal liegt die Lösung so nah...

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™