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. UEZ

Beiträge von UEZ

  • ISO Creator v1.16 build 2012-09-11 beta

    • UEZ
    • 28. Juni 2011 um 09:22

    AltairKD: vielen Dank für dein Feedback! :thumbup: Ist momentan leider nur für Daten CDs/DVDs limitiert. Mal sehen, ob ich die anderen Formate (Audio CD, etc.) auch implementieren kann.

    Ich bin in ca. 6 Std. im Flieger Richtung Urlaub -> Sonne, Strand, Meer für ca. 4 Wochen. :P Ich hoffe, ihr habt hier schönes Wetter...

    Gruß,
    UEZ

  • Herzlichen Glückwunsch Schnuffel

    • UEZ
    • 28. Juni 2011 um 09:07

    Auch von mir ein herzlichen Glückwunsch zum Geburtstag! :party:

    Gruß,
    UEZ

  • Text mit Bild Ineinanderkopieren und GUI als Bild speichern

    • UEZ
    • 26. Juni 2011 um 22:37

    Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.6.1
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <ScreenCapture.au3>
    #include <WindowsConstants.au3>
    $Form1 = GUICreate("Form1", 503, 445, 192, 124)
    $Name = GUICtrlCreateLabel("Name", 24, 312, 32, 17)
    $Input1 = GUICtrlCreateInput("Input1", 72, 312, 121, 21)
    $Level = GUICtrlCreateLabel("Level", 312, 312, 30, 17)
    $Input2 = GUICtrlCreateInput("Input2", 352, 312, 129, 21)
    $Ok = GUICtrlCreateButton("Ok", 216, 352, 75, 25, $WS_GROUP)
    $Bild = GUICtrlCreateButton("Bild", 72, 408, 99, 25, $WS_GROUP)
    $Beenden = GUICtrlCreateButton("Beenden", 368, 408, 75, 25, $WS_GROUP)
    $Pic1 = GUICtrlCreatePic("sig.jpg", 0, 0, 500, 300, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Ok
    GUICtrlCreateLabel(GUICtrlRead($Input1), 256, 32, 234, 46)
    GUICtrlSetBkColor(-1, -2)
    GUICtrlCreateLabel(GUICtrlRead($Input2), 232, 184, 252, 43)
    GUICtrlSetBkColor(-1, -2)
    Case $Bild
    GUISetState(@SW_HIDE)
    $Form1_1 = GUICreate("Form1", 503, 301, 192, 124)
    $Pic1 = GUICtrlCreatePic("sig.jpg", 0, 0, 500, 300, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    $Label1 = GUICtrlCreateLabel(GUICtrlRead($Input1), 256, 32, 82, 46)
    GUICtrlSetBkColor(-1, -2)
    $eeee = GUICtrlCreateLabel(GUICtrlRead($Input2), 232, 184, 52, 43)
    GUICtrlSetBkColor(-1, -2)
    GUISetState(@SW_SHOW)
    _ScreenCapture_CaptureWnd(@ScriptDir & "\Screenshot.jpg", $Form1_1, 0, 0, -1, -1, False)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd
    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

  • Meine Exe wird ständig decompiled

    • UEZ
    • 26. Juni 2011 um 15:03

    Einen absoluten Schutz gibt es nicht, denn alles lässt sich irgendwie reversen, aber Obsfucator + AutoIt3Camo sollten hilfreich sein, um die Decompilierer abzuschrecken.

    Der beste Schutz ist Open Source ;)

    Gruß,
    UEZ

  • _WinGetControls() - Controls eines Fensters auslesen

    • UEZ
    • 26. Juni 2011 um 14:57

    Versuche mal Control Viewer von Yashied.

    Es wäre auch nützlich, wenn wir deinen Code sehen könnten. Am besten machst du dazu einen eigenen Beitrag auf.

    Gruß,
    UEZ

  • Variablennamen ausgeben

    • UEZ
    • 26. Juni 2011 um 11:53
    [autoit]


    $test = "hallo"
    MsgBox(0,"", "Es existiert eine Variable mit dem Namen: " & $test ) ;<= hier soll der name der variable stehen, nicht der wert

    [/autoit]

    Gruß,
    UEZ

  • Weisses Quadrat beim STOP Symbol in der Messagebox entfernen

    • UEZ
    • 25. Juni 2011 um 12:35

    Hier noch eine Alternative:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <Constants.au3>
    #include <GUIConstantsEx.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>

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

    $Gui = GUICreate("Test", 200, 200, -1, -1, -1)
    $hBmp = _WinAPI_CreateBitmapFromIcon(@SystemDir & "\ieframe.dll", 61, 32, 32)
    $button = GUICtrlCreateButton(" " & " STOP", 50, 130, 140, 50,$WS_CLIPSIBLINGS)
    GUICtrlSetFont(-1, 12, 400)
    GUISetState(@SW_SHOW, $Gui)
    _WinAPI_DeleteObject(GUICtrlSendMsg($button, $BM_SETIMAGE, $IMAGE_BITMAP, $hBmp))
    _WinAPI_DeleteObject($hBmp)

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

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    Case $msg = $button
    EndSelect
    WEnd

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

    Func _WinAPI_CreateBitmapFromIcon($file, $iIndex = 0, $iW = 16, $iH = 16)
    If FileExists($file) Then
    Local $aRet, $hIcon, $hBitmap
    Local $hDC, $hBackDC, $hBackObj

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

    $aRet = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $file, "word*", $iIndex)
    If @error Then Return SetError(@error, @extended, 0)
    $hIcon = $aRet[0]

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

    $hDC = _WinAPI_GetDC(0)
    $hBackDC = _WinAPI_CreateCompatibleDC($hDC)
    $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU), $iW, $iH)
    $hBackObj = _WinAPI_SelectObject($hBackDC, $hBitmap)
    _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, $iW, $iH, 0, 0, 3)
    _WinAPI_DestroyIcon($hIcon)

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

    _WinAPI_SelectObject($hBackDC, $hBackObj)
    _WinAPI_ReleaseDC(0, $hDC)
    _WinAPI_DeleteDC($hBackDC)
    Return $hBitmap
    Else
    Return SetError(1, 0, 0)
    EndIf
    EndFunc ;==>_WinAPI_CreateBitmapFromIcon

    [/autoit]

    Getestet auf Win7 x64 + Aero.

    Gruß,
    UEZ

  • Anführunsgzeichen in eine Variable

    • UEZ
    • 24. Juni 2011 um 14:01
    [autoit]


    $string = '"Ein String mit Anführungszeichen"'

    [/autoit]

    Gruß,
    UEZ

  • ISO Creator v1.16 build 2012-09-11 beta

    • UEZ
    • 22. Juni 2011 um 01:12

    Aktualisiert.

    Gruß,
    UEZ

  • _GDIPlus_PenCreate(Farbe) gibt "True" zurück, funktioniert dennoch nicht

    • UEZ
    • 19. Juni 2011 um 18:44

    Du hast bei den Farben einen Fehler gemacht -> _GDIPlus_PenCreate([$iARGB = 0xFF000000[, $nWidth = 1[, $iUnit = 2]]]) Die Farben bestehen aus 4 Tupeln -ARGB

    $Stift = _GDIPlus_PenCreate(0xFF00FF00);grün müsste funzen!

    Gruß,
    UEZ

  • Alina feiert heute ;)

    • UEZ
    • 19. Juni 2011 um 16:51

    Happy Birthday und alles Gute auch von mir!

    Gruß,
    UEZ

  • L3viathan hat Geburtstag

    • UEZ
    • 17. Juni 2011 um 15:45

    Auch von mir ein Happy Birthday und alles Gute!

    Gruß,
    UEZ

  • ISO Creator v1.16 build 2012-09-11 beta

    • UEZ
    • 17. Juni 2011 um 01:05

    Hi,

    hier ein kleines Tool, um ISO-Dateien von Standard ISO 9660 (2048 Byte / Sektor) CDs-oder DVDs zu erstellen!

    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Source Code kann hier eingesehen werden: HIER (zu groß für die Code Box hier!)


    Download: ISO Creator v1.16 build 2012-09-11 beta.7z

    Kompilierte Exen (x86) können hier herunter geladen werden: 4shared.com oder MediaFire


    ISO Creator.au3: pur in AutoIt ohne 3rd Party Tools

    v1: benutzt cd2iso.exe
    v2: benutzt cd2iso.dll direkt vom Speicher (DLL wurde von smartee erstellt)
    v1 und v2 wird nicht mehr weiter entwickelt (Stand: ISO Creator v1.0.0 build 2011-08-03 beta v1/v2)!


    Aufruf per Commandline: ISO Creator.exe -s [source cd/dvd drive] -d [filename] (-md5) (-aem) (-exit)

    -s und -d sind Pflichtfelder. -md5 erstellt die MD5 Checksumme der ISO Datei, -aem wirft die CD/DVD Schublade automatisch aus und -exit beendet das Programm nach dem Erstellen des ISOs.

    Bei Bugs bitte hier posten!

    Gruß,
    UEZ


    Mehr Infos im engl. Forum!


    Change Log:

    Spoiler anzeigen


    2011-06-17: Option zur Erstellung einer MD5 Checksumme hinzugefügt + Hintergrund Bild in der Input Box hinzugefügt
    2011-06-18: Cursor blinken deaktiviert
    2011-06-19: ISO Creator kann jetzt auch per Commandline Parameter aufgerufen werden -> ISO Creator.exe -s <source> -d <destination>
    2011-06-20: Mehr Information wird jetzt in der Combo Box dargestellt
    2011-06-21: Einige kleinere Feature eingebaut
    2011-06-22: CD001 Check auch für EL TORITO SPECIFICATION Sektion hinzugefügt und einige Fehler beseitigt
    2011-06-22: Commandline Parameter -exit hinzugefügt + Hintergrundbild kann jetzt geändert werden + Bugfixes
    2011-08-03: einige "kosmetische" Änderungen
    2011-08-19: kleine Verbesserungen + Optionen zum Anschauen wie die Sektoren gelesen werden (CD Icon rechts unten). Version v1 und v2 sind eingestellt!
    2011-08-23: kleine interne Änderungen bzgl. GDI+ und Info im Disk Bild ausgetasucht gegen x / Size MB
    2011-08-23: ein ISO 9660 Check entfernt, damit auch DVDs im UDF Format als ISO angelegt werden können und Sektoren wurden nicht auf dem Disc Bild gezeichnet
    2011-08-30: fehlerhafte Darstellung der MB Größe auf dem Disc Bild und jetzt kann man MD5 Checksummen von ISO direkt erstellen
    2011-09-11: Sound hinzugefügt, wenn fertig bzw. abgebrochen + Update Funktion
    2011-09-24: ISO Check Funktion verändert
    2011-10-04: Fine Tuning an der MD5 Funktion
    2011-12-28: Bug in Combobox gefixt und Check hinzugefügt, wenn kein Laufwerk vorhanden ist
    2012-03-06: Parameter $iSharer in _WinAPICreateFile() (ISO check function) Zeile hinzugefügt, da ansonsten die ISO Check Funktionen einen Fehler zurück geben kann
    2012-09-10: Bug in der CD Anzeige und in der Update Check Funktion entfernt, Taskbar Progressbar und automatisches Auswerfen des Laufwerks hinzugefügt
    2012-09-11: Bug behoben, wenn ext. USB Laufwerk angeschlossen wird (Programm Absturz) und ComboBox hatte nicht richtig funktioniert, DVD+RW DL und DVD+R DL Medientypen hinzugefügt

    Bilder

    • ISO Creator.jpg
      • 7,66 kB
      • 404 × 101

    Dateien

    ISO Creator v1.au3 100,95 kB – 561 Downloads ISO Creator v2.au3 116,44 kB – 607 Downloads
  • AutoIT Eventlog, nur eine ID auswerten

    • UEZ
    • 16. Juni 2011 um 13:46

    Hier was altes von mir:

    Spoiler anzeigen
    [autoit]


    ;Coded by UEZ 2009
    #AutoIt3Wrapper_Change2CUI=y
    #AutoIt3Wrapper_UseUpx=n
    #Include <Date.au3>
    $oMyError = ObjEvent("AutoIt.Error", "oMyError") ; Install a custom error handler

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

    Global $ip = "localhost"
    If $CmdLine[0] > 0 Then $ip = $CmdLine[1]

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

    $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $ip & "\root\cimv2")

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

    ConsoleWrite(GetWMI($ip, 7, 123))

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

    Func GetWMI($srv, $d = 7, $n = "", $cat = "System")
    Local $Eventlog_Err, $Eventlog_Err_Logfile, $Eventlog_Err_EventType, $Eventlog_Err_EventID, $Eventlog_Err_TimeGenerated, $Eventlog_Err_SourceName, $Eventlog_Err_InsertionStrings, $Eventlog_Err_Message
    Local $date_threshold, $days_threshold, $date_threshold_WQL, $now, $x;, $tmp
    $ping = Ping($srv)
    If $ping Then
    $days_threshold = -1 * $d ; how many days should be looked into the past for error - 0 = today
    $now = _NowCalc()
    $date_threshold = _DateAdd('d', $days_threshold, $now) ;get the date / time value fom past
    $date_threshold_WQL = StringLeft(StringReplace(StringReplace(StringReplace(_DateAdd('d', $days_threshold, $now), ":", ""), "/", ""), " ", ""), 8) ;convert to WQL-Supported Date Formats
    If $n = "" Then
    $colItems = $objWMIService.ExecQuery("SELECT Logfile, EventType, EventCode, TimeGenerated, SourceName, InsertionStrings, Message FROM Win32_NTLogEvent WHERE LogFile='" & $cat & "' AND TimeGenerated >= '" & $date_threshold_WQL & "' AND EventType=1", "WQL", 0x30)
    Else
    $colItems = $objWMIService.ExecQuery("SELECT Logfile, EventType, EventCode, TimeGenerated, SourceName, InsertionStrings, Message FROM Win32_NTLogEvent WHERE EventCode = '" & $n & "' And LogFile='" & $cat & "' AND TimeGenerated >= '" & $date_threshold_WQL & "' AND EventType=1", "WQL", 0x30)
    EndIf
    If IsObj($colItems) Then
    For $objItem In $colItems
    $Eventlog_Err_Logfile = $objItem.Logfile
    $Eventlog_Err_EventType = $objItem.EventType
    $Eventlog_Err_EventID = $objItem.EventCode ;$objItem.EventIdentifier
    $Eventlog_Err_TimeGenerated = WMIDateStringToDate2($objItem.TimeGenerated)
    $Eventlog_Err_SourceName = $objItem.SourceName
    $Eventlog_Err_InsertionStrings = ""
    For $x = 0 To UBound($objItem.InsertionStrings) - 1
    If Number($objItem.InsertionStrings($x)) = 0 And StringLeft($objItem.InsertionStrings($x), 2) <> "%%" And $objItem.InsertionStrings($x) <> "" And StringLen($objItem.InsertionStrings($x)) > 1 Then ;skip unneeded strings
    $Eventlog_Err_InsertionStrings &= StringStripWS(StringReplace(StringReplace($objItem.InsertionStrings($x), Chr(10), ""), Chr(13), ""), 7) & ", "
    EndIf
    Next
    $Eventlog_Err_InsertionStrings = StringTrimRight($Eventlog_Err_InsertionStrings, 1)
    $Eventlog_Err_Message = StringStripWS(StringReplace(StringReplace($objItem.Message, Chr(10), ""), Chr(13), ""), 7)
    $Eventlog_Err &= $srv & ";" & $Eventlog_Err_Logfile & ";" & $Eventlog_Err_EventType & ";" & $Eventlog_Err_EventID & ";" & $Eventlog_Err_TimeGenerated & ";" & $Eventlog_Err_SourceName & ";" & $Eventlog_Err_InsertionStrings & ";" & $Eventlog_Err_Message & ";" & @CRLF
    Next
    Return $Eventlog_Err
    Else
    Return SetError(2, 0, "Error!")
    EndIf
    Else
    Return SetError(1, 0, "Host not reachable")
    EndIf
    EndFunc

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

    Func WMIDateStringToDate2($dtmDate)
    Return (StringMid($dtmDate, 7, 2) & "." & StringMid($dtmDate, 5, 2) & "." & StringLeft($dtmDate, 4) & " " & _
    StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate, 13, 2))
    EndFunc ;==>WMIDateStringToDate2

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

    Func oMyError()
    Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oMyError.Description & @CRLF & _
    "err.windescription:" & @TAB & $oMyError.WinDescription & @CRLF & _
    "err.number is: " & @TAB & Hex($oMyError.Number, 8) & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oMyError.LastDllError & @CRLF & _
    "err.scriptline is: " & @TAB & $oMyError.Scriptline & @CRLF & _
    "err.source is: " & @TAB & $oMyError.Source & @CRLF & _
    "err.helpfile is: " & @TAB & $oMyError.Helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oMyError.HelpContext _
    , 20)
    EndFunc

    [/autoit]

    Kannst es ja anpassen.

    Gruß,
    UEZ

  • Button-Klick

    • UEZ
    • 16. Juni 2011 um 12:41

    Von welcher Web Seite ist diese Anmeldung?

    Mehr Informationen würden nicht schaden...

    Gruß,
    UEZ

  • Mathematisches Problem

    • UEZ
    • 16. Juni 2011 um 12:40

    Um zu sehen, ob die Berechnung wirklich falsch ist, würde ich die extra Txt Dateien noch mit anhängen.

    Gruß,
    UEZ

  • RegExp erstellen

    • UEZ
    • 16. Juni 2011 um 11:42

    Wenn man das Ganze in Echtzeit checken will, ist das nicht so einfach.

    Hier eine Teillösung:

    Spoiler anzeigen
    [autoit]


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

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

    $hGUI = GUICreate("Test", 200, 60)
    $idInput = GUICtrlCreateInput("", 10, 10, 100, 20)
    $idButton = GUICtrlCreateButton("Exit", 150, 10, 40, 40)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState()

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

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE, $idButton
    GUIDelete($hGUI)
    Exit
    EndSwitch
    WEnd

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

    Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $i
    Switch BitAND($wParam, 0x0000FFFF)
    Case $idInput
    $i = GUICtrlRead($idInput)
    $ii = StringRegExpReplace($i, "[^0-9.]", "")
    If StringLen($ii) < 5 Then
    If Not StringRegExp($ii, "[1-7][0-3]\d{2}", 3) Then
    GUICtrlSetData($idInput, StringLeft($ii, 1) & "." & StringMid($ii, 2))
    GUICtrlSetState($idButton, $GUI_ENABLE)
    Else
    GUICtrlSetData($idInput, $ii)
    EndIf
    Else
    GUICtrlSetData($idInput, StringLeft($ii, 5))
    EndIf
    EndSwitch
    Return "GUI_RUNDEFMSG"
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Fokus setzen nach Auswahl in Combo Box

    • UEZ
    • 14. Juni 2011 um 20:21

    Vielen Dank BugFix! Das Problem lag an der falschen GUIRegisterMsg Konstante, aber laut der Hilfe unter _GUICtrlComboBoxEx_Create

    Zitat


    Case $CBEN_ENDEDITA, $CBEN_ENDEDITW ; Sent when the user has concluded an operation within the edit box or has selected an item from the control's drop-down list.

    wird $CBEN_ENDEDITA, $CBEN_ENDEDITW benutzt, um das Ende der Selektion einer Combo Box abzufragen und das mit WM_Notify.

    Problem gelöst und vielen Dank für die Beispiele! ;)

    Gruß,
    UEZ

  • Fokus setzen nach Auswahl in Combo Box

    • UEZ
    • 14. Juni 2011 um 17:27

    Hi,

    ich komme momentan nicht weiter! Ich möchte den Fokus nach einer Auswahl aus der Combo Box auf das Set Button setzen, da sonst die Farbe, die man in der Combo Box ausgewählt hat, durch den Fokus auf der Combo Box falsch dargestellt wird, z.B. das hell gelbe wird grün dargestellt, wenn der Fokus auf der Combo Box ist.

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    #include <ComboConstants.au3>
    #include <Constants.au3>
    #include <EditConstants.au3>
    #include <GuiComboBoxEx.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiImageList.au3>
    #include <Misc.au3>
    #include <SliderConstants.au3>
    #include <StructureConstants.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    Global $hGUI = GUICreate("")
    GUISetState()
    Global $load_auto = ""
    Global $load_auto, $GUI_Bg_Color = 0xB9D1EA, $ping_to = 500
    Global Const $ini_file = @ScriptDir & "\Check Online Status.ini"

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

    Global $hComboColor, $hGUI_Settings, $hProc, $hHook
    Settings()

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

    Exit

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

    Func Settings()
    GUISetState(@SW_DISABLE, $hGUI)
    $hGUI_Settings = GUICreate("Settings", 612, 229, -1, -1, $GUI_SS_DEFAULT_GUI, Default, $hGUI)
    Local Const $iAutoLoadFile = GUICtrlCreateInput($load_auto, 152, 16, 369, 22)
    GUICtrlSetFont(-1, 9, 400, 0, "Arial")
    Local Const $lLoadAuto = GUICtrlCreateLabel("Load List Automatically", 8, 18, 140, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    GUICtrlSetTip(-1, "Select a file which will be loaded to the program automatically")
    Local Const $bBrowse = GUICtrlCreateButton("&Browse", 528, 14, 75, 25)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    Local Const $lBgColor = GUICtrlCreateLabel("Change GUI background color", 6, 58, 177, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    ;~ Local Const $lBgColorAdd = GUICtrlCreateLabel("Add new color", 6, 97, 97, 20)
    ;~ GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    ;~ Local Const $bAddColor = GUICtrlCreateButton("Add &Color", 105, 94, 75, 25)
    ;~ GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    $hComboColor = _GUICtrlComboBoxEx_Create($hGUI_Settings, "", 192, 56, 329, 200, BitOR($CBS_DROPDOWNLIST, $CBS_DISABLENOSCROLL))
    ;~ $hComboColor = GUICtrlCreateCombo("", 192, 56, 329, 200, BitOR($CBS_DROPDOWNLIST, $CBS_DISABLENOSCROLL))
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hComboColor = ' & $hComboColor & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    GUICtrlSetData(-1, "item2|item3", "item3")
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    Local Const $bSet = GUICtrlCreateButton("&Set", 528, 55, 75, 64)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    Local Const $bApply = GUICtrlCreateButton("&Apply", 528, 180, 75, 40)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    Local Const $bExit_Setting = GUICtrlCreateButton("E&xit", 438, 180, 75, 40)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    Local Const $cSlider = GUICtrlCreateSlider(88, 138, 440, 30, BitOR($TBS_BOTH,$TBS_NOTICKS, $TBS_ENABLESELRANGE, $TBS_FIXEDLENGTH, $WS_TABSTOP))
    GUICtrlSetLimit(-1, 5000, 100)
    GUICtrlSetData(-1, 500)
    GUICtrlSetCursor (-1, 0)
    Local Const $lSlider = GUICtrlCreateLabel("Ping Timeout", 8, 141, 80, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")
    GUICtrlSetTip(-1, "Default is 500 ms")
    Local Const $iPing = GUICtrlCreateInput($ping_to, 528, 140, 74, 21, BitOR($ES_CENTER, $ES_NUMBER))
    GUICtrlSetFont(-1, 10, 400, 0, "Arial")

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

    GUISetState(@SW_SHOW, $hGUI_Settings)
    ControlFocus($hGUI_Settings, "", $bExit_Setting)
    GUISetIcon(@SystemDir & "\Shell32.dll", 14, $hGUI_Settings)
    Local $nMsg, $i, $file, $cindex, $em, $p, $newcolor

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

    Local $aColors[7] = [0xB9D1EA, 0xC0DCC0, 0xD7E4F2, 0xFFFFE1, 0xA6CAF0, 0xFFFBF0, 0xFECFF4]

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

    Local Const $hImage = _GUIImageList_Create(256, 56, 5, 3)
    For $i = 0 To 6
    _GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hComboColor, $aColors[$i], 256, 56))
    Next
    _GUICtrlComboBoxEx_SetImageList($hComboColor, $hImage)

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

    _GUICtrlComboBoxEx_BeginUpdate($hComboColor)
    For $i = 0 To 6
    _GUICtrlComboBoxEx_AddString($hComboColor, "Color " & $i + 1, $i, $i)
    Next
    _GUICtrlComboBoxEx_EndUpdate($hComboColor)

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

    $cindex = _ArraySearch($aColors, $GUI_Bg_Color)
    If Not @error Then
    _GUICtrlComboBoxEx_SetCurSel($hComboColor, $cindex)
    Else
    _GUICtrlComboBoxEx_SetCurSel($hComboColor, 0)
    EndIf

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

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE, $bExit_Setting
    GUISetState(@SW_ENABLE, $hGUI)
    GUIDelete($hGUI_Settings)
    Return 1
    Case $cSlider
    GUICtrlSetData($iPing, GUICtrlRead($cSlider))
    Case $iPing
    $p = GUICtrlRead($iPing)
    If $p > 5000 Then
    $p = 500
    ElseIf $p < 100 Then
    $p = 100
    EndIf
    GUICtrlSetData($cSlider, $p)
    Case $bBrowse
    $file = FileOpenDialog("File Selection", "", "Text Files (*.txt;*.csv)")
    If Not @error Then GUICtrlSetData($iAutoLoadFile, $file)
    Case $bSet
    $GUI_Bg_Color = "0x" & Hex($aColors[_GUICtrlComboBoxEx_GetCurSel($hComboColor)], 6)
    GUISetBkColor($GUI_Bg_Color, $hGUI)
    Case $bApply
    $GUI_Bg_Color = "0x" & Hex($aColors[_GUICtrlComboBoxEx_GetCurSel($hComboColor)], 6)
    GUISetBkColor($GUI_Bg_Color, $hGUI)
    IniWrite($ini_file, "Bg-Color", "Color", "0x" & Hex($aColors[_GUICtrlComboBoxEx_GetCurSel($hComboColor)], 6))
    $em = @error
    IniWrite($ini_file, "Auto-Load", "Load", GUICtrlRead($iAutoLoadFile))
    $em = @error
    IniWrite($ini_file, "Ping-Timeout", "Ping", GUICtrlRead($iPing))
    $em = @error
    If $em Then
    MsgBox(16, "Error", "Unable to save one or more settings to ini file!", 10)
    Else
    MsgBox(64, "Information", "Settings were save to " & $ini_file & " successfully", 10)
    EndIf
    ;~ Case $bAddColor
    ;~ $newcolor = _ChooseColor(2, 0, 2, $hGUI_Settings)
    ;~ If Not @error Then
    ;~ ConsoleWrite($newcolor & @CRLF)
    ;~ EndIf
    EndSwitch
    WEnd
    EndFunc

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

    Func WM_NOTIFY($hWnd, $iMsg, $wParam, $iParam)
    ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $wParam = ' & $iParam & "/" & Hex(BitAND($iParam, $hComboColor)) & "," & $hComboColor & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR

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

    $tNMHDR = DllStructCreate($tagNMHDR, $iParam)
    $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hWndFrom = ' & $hWndFrom & "/" & $hComboColor & "/" & $hGUI_Settings & "," & $hGUI & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")

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

    Switch $hWndFrom
    Case $hComboColor
    Switch $iCode
    Case $CBEN_ENDEDITA, $CBEN_ENDEDITW ; Sent when the user has concluded an operation within the edit box or has selected an item from the control's drop-down list.
    ConsoleWrite("huhu")
    Return False ; accept the notification and allow the control to display the selected item
    Case Else
    ;~ ConsoleWrite(Hex($iCode) & "/ " & Hex($CBEN_ENDEDITA) & "," & Hex($CBEN_ENDEDITW) & @CRLF)
    EndSwitch

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

    EndSwitch
    Return "GUI_RUNDEFMSG"
    EndFunc ;==>WM_NOTIFY

    [/autoit]

    BugFix hat mir einige Beispiele geschickt, um das Ganze mit DllCallbackRegisters (Hooking) zu lösen, nur sehe ich nicht den Vorteil gegenüber der "normalen" Variante mit GUIRegisterMsg(), was doch auch eigentlich ein DllCallbackRegister ist, oder? Abgesehen davon, habe ich auch keinen Erfolg mit DCR!

    Danke und Gruß,
    UEZ

  • GDI+ Schwarzes Loch & Maus Text Verfolger

    • UEZ
    • 14. Juni 2011 um 09:23

    Wunderschöne Beispiele (wie immer). :thumbup:

    Stark: die Schatten der Bälle 8o

    Gruß,
    UEZ

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™