GuiCtrlRead

  • Hallo, ich habe folgende frage.


    Ich habe ein neues GUI erstellt und dabei 4 Radio Buttons...


    Jetzt möchte ich das bei jeweils einem Radio Button ein File Kopiert wird...

    Spoiler anzeigen
    [autoit]


    If GuiCTRLRead($1) = $GUI_CHECKED Then
    FIleCOpy(C:\1.html", @UserProfileDir & "DeskTop\")
    Else
    GuiCTRLRead($2) = $GUI_CHECKED Then
    FIleCOpy(C:\1.html", @UserProfileDir & "DeskTop\")
    Elseif
    GuiCTRLRead($3) = $GUI_CHECKED Then
    FIleCOpy(C:\1.html", @UserProfileDir & "DeskTop\")
    Else
    GuiCTRLRead($4) = $GUI_CHECKED Then
    FIleCOpy(C:\1.html", @UserProfileDir & "DeskTop\")
    EndIf

    [/autoit]

    Kann man das so machen?

  • Poste am besten mal dein ganzes Skript mit so Codeschnipseln kann man nichts richtiges anfangen!
    Sieht ein bisschen durcheinander aus und Funktioniert so nicht. Habs dir bisschen Sortiert:

    Spoiler anzeigen
    [autoit]

    If GUICtrlRead($1) = $GUI_CHECKED Then
    FileCopy("C:\1.html", @UserProfileDir & "DeskTop\")
    ElseIf GUICtrlRead($2) = $GUI_CHECKED Then
    FileCopy("C:\1.html", @UserProfileDir & "DeskTop\")
    ElseIf GUICtrlRead($3) = $GUI_CHECKED Then
    FileCopy("C:\1.html", @UserProfileDir & "DeskTop\")
    ElseIf GUICtrlRead($4) = $GUI_CHECKED Then
    FileCopy("C:\1.html", @UserProfileDir & "DeskTop\")
    EndIf

    [/autoit]
    • Offizieller Beitrag
    [autoit]

    If BitAND(GUICtrlRead($1), $GUI_CHECKED) Then
    FileCopy("C:\1.html", @UserProfileDir & "\DeskTop\")
    ElseIf BitAND(GUICtrlRead($2), $GUI_CHECKED) Then
    FileCopy("C:\1.html", @UserProfileDir & "\DeskTop\")
    ElseIf BitAND(GUICtrlRead($3), $GUI_CHECKED) Then
    FileCopy("C:\1.html", @UserProfileDir & "\DeskTop\")
    ElseIf BitAND(GUICtrlRead($4), $GUI_CHECKED) Then
    FileCopy("C:\1.html", @UserProfileDir & "\DeskTop\")
    EndIf

    [/autoit]
  • Wow Danke, es klappt...

    Jetzt hab ich nur noch eine frage... Ich habe auf dem Desktop ein .html Dekoment...
    Ich möchte jetzt dass sich per Buttonklick ein Fenster öffnen und man dieses HTML Dokument (so wie FIleMove) dann speicher kann, wo man will (wie z.B Datei>Speichern)...


    Jetzt habe ich versucht mitdies mit ShellExecute("wordpad.exe", "", @UserProfileDir & "\DeskTop\", @SW_MINIMIZE) zu realisieren... Aber hat jemand eine andere Möglichkeit?

  • Probiere es mal hiermir:

    [autoit]

    FileSaveDialog

    [/autoit]


    Müsste das sein was du meinst!

    MfG Tobi

  • Hm ich hab jetzt einen andere Idee...

    Ich will Die datei doch per Buttonklick auf eine Festplatte kopieren (a-z)

    Soweit bin ich ...

    Spoiler anzeigen
    [autoit]


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

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

    #NoTrayIcon

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

    #Region ### START Koda GUI section ### Form=
    $Form4 = GUICreate("Select Driver", 250, 55, 208, 136)
    $Combo = GUICtrlCreateCombo("a", 8, 16, 145, 25)
    $Combo = GUICtrlSetData(-1,"b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z", "a")
    $go = GUICtrlCreateButton("Los!", 160, 16, 75, 17, $WS_GROUP)
    GUISetState(@SW_Show,$Form4)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $go
    GUICtrlSetOnEvent($combo, "_comboread")

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

    EndSwitch
    Wend

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

    Func _comboread()
    $read = GUICtrlRead($combo)

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

    If $read = "a" Then FIleCOpy("C:\*.html","A:\Log\",9)
    If $read = "b" Then FIleCOpy("C:\*.html","B:\Log\",9) ;von a - z

    [/autoit]


    EndFunc

    Einmal editiert, zuletzt von RayRayatTorrex (17. Oktober 2009 um 00:55)

  • Hallo RayRayatTorrex,

    mach es doch einfach so:

    Spoiler anzeigen
    [autoit]

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

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

    #NoTrayIcon

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

    $sElect = "Bitte ein Laufwerk auswählen: "
    #Region ### START Koda GUI section ### Form=
    $Form4 = GUICreate("Select Driver", 250, 55, 208, 136)
    $Combo = GUICtrlCreateCombo($sElect, 8, 16, 145, 25)
    For $i = 65 To 90
    GUICtrlSetData($Combo, Chr($i))
    Next
    ;$Combo = GUICtrlSetData(-1, , "a")
    $go = GUICtrlCreateButton("Los!", 160, 16, 75, 17, $WS_GROUP)
    GUICtrlSetState($go, $GUI_DISABLE)
    GUISetState(@SW_SHOW, $Form4)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Combo
    If GUICtrlRead($Combo) = $sElect Then
    GUICtrlSetState($go, $GUI_DISABLE)
    Else
    GUICtrlSetState($go, $GUI_ENABLE)
    EndIf

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

    Case $go
    _comboread()

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

    EndSwitch
    WEnd

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

    Func _comboread()
    $read = GUICtrlRead($Combo)
    If StringLen($read) = 1 Then
    $read = $read & ":\Log\"
    ConsoleWrite("COMBOREad " & $read & " " & @CRLF)
    FileCopy("C:\*.html", $read, 9)
    EndIf
    EndFunc ;==>_comboread

    [/autoit]

    mfg (Auto)Bert