MsgBox - Maus

  • Nadann ...
    Danke ,,,
    aber könnte mir vllt jemand sagen was falsch ist ?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

    Case $Button1
    $status = Not $status
    If $status Then
    $pos_Button1 = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    EndSwitch
    WEnd

    [/autoit]

    Er sagt immer:
    Endswitch Statement has no matching Switch statement ?(

    Danke im Voraus

    Jaja, Moo does the Cow!

  • Hi der fehler liegt unten bei der If-schleife. Dort fehlt ein endif.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    Case $Button1
    $status = Not $status
    If $status Then
    $pos_Button1 = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    endif
    EndSwitch
    WEnd

    [/autoit]
  • Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    Case $Button1
    $status = Not $status
    If $status Then
    $pos_Button1 = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    EndIf ; -> hat gefehlt
    EndSwitch
    WEnd

    [/autoit]
  • Vielen Danke aber irgentwie Funktioniert das mit der Mousetrap funk. nicht mehr ... ?
    Und wenn ich auf dem Button klicke sag er/sie/es
    $status = Not $status
    Error: Variable used without being declared! ... ???
    ( Entschuldigt meine ganzen fragen, mache das ganze erst seit vorgestern Oo)

    Vielen vielen vielen [SIZE=7]vielen[/SIZE] DANK!
    Naja ....

    Jaja, Moo does the Cow!

    Einmal editiert, zuletzt von Lenny (10. August 2007 um 09:04)

    • Offizieller Beitrag

    Hi,

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <Misc.au3>

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

    Global $status = 0

    #Region ### START Koda GUI section ### Form=
    $gui = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    Case $Button1
    $status = Not $status
    If $status Then
    $pos_A = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    EndIf ; -> hat gefehlt
    EndSwitch
    WEnd

    [/autoit]

    So long,

    Mega

    • Offizieller Beitrag
    Zitat

    Original von Warlenny
    Hallllo
    Ja supi! Vielen dank!

    Aber kann man es irgentwie hinbekommen das der mauszeiger von anfang an nicht heruas kann ?

    Edit: Hab's nochmal geändert. In der bisherigen Version konnte _MouseTrap() durch Verschieben der GUI ausgehebelt werden. ;)
    Jetzt wird alle 500 ms _MouseTrap neu gesetzt.

    Kann man:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <Misc.au3>

    Global $pos_A

    #Region ### START Koda GUI section ### Form=
    $gui = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    $begin = TimerInit()
    While WinExists($gui)
    If TimerDiff($begin) > 500 Then
    $pos_A = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    $begin = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button2
    MsgBox(0, '', "Button2 gedrückt")
    Exit
    Case $Button1
    MsgBox(0, '', "Button1 gedrückt")
    EndSwitch
    WEnd

    [/autoit]
  • Hiho !
    Vielen Dank!
    Genau sowas meinte ich !
    Funktioniert super !

    DANKE DANKE DANKE

    LEnny

    Nur eines noch :
    Könnte man das hier

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <Misc.au3>

    Global $pos_A

    #Region ### START Koda GUI section ### Form=
    $gui = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    $begin = TimerInit()
    While WinExists($gui)
    If TimerDiff($begin) > 500 Then
    $pos_A = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    $begin = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button2
    MsgBox(0, '', "Button2 gedrückt")
    Exit
    Case $Button1
    MsgBox(0, '', "Button1 gedrückt")
    EndSwitch
    WEnd

    [/autoit]
    [autoit][/autoit]
    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Windows", 582, 93, 193, 115)
    $Icon1 = GUICtrlCreateIcon("D:\Dokumente und Einstellungen\Lenny\Eigene Dateien\Azureus Downloads\Photoshop CS2\AutoPlay\RESDATA\CS2_AutoplayQuit_Md_N.ico", 0, 16, 16, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
    $Label1 = GUICtrlCreateLabel("Grober Fehler des pfades rundll32.exe eine neuinstallation ihres Systems könnte das problem beheben!", 80, 32, 485, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

    [/autoit]


    Irgentwie kombinieren sodaß wenn man den Button 2 (cancel)
    klickt so eine meldung kommt und dann wieder zurück zur Box kommt ?

    Lenny

    Jaja, Moo does the Cow!

    3 Mal editiert, zuletzt von Lenny (10. August 2007 um 11:31)

    • Offizieller Beitrag

    Verstehe nicht ganz, was du meinst.
    Soll hier jetzt ein Button rein? Und wohin willst du zurück?

    Spoiler anzeigen
    [autoit]

    #include <misc.au3>
    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Windows", 582, 93, 193, 115)
    $Icon1 = GUICtrlCreateIcon("D:\Dokumente und Einstellungen\Lenny\Eigene Dateien\Azureus Downloads\Photoshop CS2\AutoPlay\RESDATA\CS2_AutoplayQuit_Md_N.ico", 0, 16, 16, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
    $Label1 = GUICtrlCreateLabel("Grober Fehler des pfades rundll32.exe eine neuinstallation ihres Systems könnte das problem beheben!", 80, 32, 485, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    $begin = TimerInit()
    While WinExists($Form1)
    If TimerDiff($begin) > 500 Then
    $pos_A = WinGetPos($Form1)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    $begin = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_Event_Close
    Exit
    EndSwitch
    WEnd

    [/autoit]
  • Hallo .. !
    Sorry für die Blöde erklärung !

    Also ich habe mir über Koda ein GUI gemacht
    und jetzt möchte ich das, wenn ich "cancel" klicke dieser gui zum einsatz kommt! Und wenn ich da auf OK geklickt habe möchte ich wieder zu der Frage am anfang!

    GUI:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Windows", 582, 93, 193, 115)
    $Icon1 = GUICtrlCreateIcon("http://www.mkportal-support.de/mkportal/templates/MKPBlue/images/error.gif", 0, 16, 16, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
    $Label1 = GUICtrlCreateLabel("Müll müll Ka Quatsch!", 80, 32, 485, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

    [/autoit]

    also :

    Spoiler anzeigen


    [Blockierte Grafik: http://warlenny.funsurf.org/klick.PNG]
    Und dann:
    [Blockierte Grafik: http://warlenny.funsurf.org/button.PNG]

    DANKE schön ...

    Jaja, Moo does the Cow!

    5 Mal editiert, zuletzt von Lenny (10. August 2007 um 12:00)

    • Offizieller Beitrag

    Meinst du so?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <Misc.au3>

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


    #Region ### START Koda GUI section ### Form=
    $gui = GUICreate("Dialog", 316, 231, 347, 263, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetIcon("D:\003.ico")
    $GroupBox1 = GUICtrlCreateGroup("Festplatte Formatieren?", 8, 1, 297, 193)
    GUICtrlSetFont(-1, 20, 400, 0, "comic")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("&OK", 65, 203, 75, 25, 0)
    GUICtrlSetTip(-1, "Danke!")
    GUICtrlSetCursor ($Button1, 3)
    $Button2 = GUICtrlCreateButton("&Cancel", 162, 203, 75, 25, 0)

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

    $Form1 = GUICreate("Windows", 582, 93, 193, 115)
    $Icon1 = GUICtrlCreateIcon("D:\Dokumente und Einstellungen\Lenny\Eigene Dateien\Azureus Downloads\Photoshop CS2\AutoPlay\RESDATA\CS2_AutoplayQuit_Md_N.ico", 0, 16, 16, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
    $Label1 = GUICtrlCreateLabel("Grober Fehler des pfades rundll32.exe eine neuinstallation ihres Systems könnte das problem beheben!", 80, 32, 485, 17)

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

    GUISetState(@SW_SHOW, $gui)
    #EndRegion ### END Koda GUI section ###

    $begin = TimerInit()
    While WinExists($gui)
    If WinActive($gui) And (TimerDiff($begin) > 500) Then
    $pos_A = WinGetPos($gui)
    _MouseTrap($pos_A[0], $pos_A[1], $pos_A[0] + $pos_A[2], $pos_A[1] + $pos_A[3])
    $begin = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button1
    MsgBox(0, '', "Button1 gedrückt")
    Exit
    Case $Button2
    GUISetState(@SW_HIDE, $gui)
    GUISetState(@SW_SHOW, $Form1)
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $gui)
    GUISetState(@SW_HIDE, $Form1)
    EndSwitch
    WEnd

    [/autoit]
  • Haiii!
    geanial! vielen dank an alle!
    Auf meiner seite sind alle fragen beantwortet!

    Vielen vielne vielen vielen DANK


    Ps: kann man mein signatur bild sehen ? XD


    DANKE

    Jaja, Moo does the Cow!