Problem mit GuiGetCursorInfo

  • Hallo,

    ich wollte gerade einen Script machen, das ein Bild, solange es gerdrückt wird nicht ausgewählt wird.
    Das heißt, wenn ich auf einem Bild klicke und die Maus gedrückt halte soll nichts passieren. Aber wenn ich es über diesem Bild loslasse soll eine Msgbox auftauchen. Hat jemand eine Idee?

    [autoit]

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

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

    EndSwitch
    $Cursorinfo1 = GUIGetCursorInfo($Form1)
    If $Cursorinfo1[4] = $Pic1 And $Cursorinfo1[2] = 1 Then
    While 1
    $Cursorinfo2 = GUIGetCursorInfo($Form1)
    If $Cursorinfo2[2] = 0 Then
    If Not $Cursorinfo2[4] = $Pic1 Then
    MsgBox(0, "", "nICHT")
    ExitLoop
    EndIf
    EndIf
    Sleep(10)
    WEnd
    EndIf
    Sleep(10)
    WEnd

    [/autoit]
  • Villt hab ich mich nicht richtig ausgedrückt. Also bis jetzt funktioniert mein Script zu 50. Wenn ich auf das Bild klicke wird ja solange gewartet bis man es über dem bild loslässt. Aber wenn ich auf das Bild klicke und daneben en Mauszeiger wieder loslasse, erscheint die MsgBox, wenn ich nochmal über das Pic fahre.

    Spoiler anzeigen
    [autoit]

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

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

    EndSwitch

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

    $Cursorinfo1 = GUIGetCursorInfo($Form1)

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

    If $Cursorinfo1[4] = $Pic1 And $Cursorinfo1[2] = 1 Then

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

    While 1

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

    $Cursorinfo2 = GUIGetCursorInfo($Form1)

    If $Cursorinfo2[2] = 0 And $Cursorinfo2[4] = $Pic1 Then

    If $Cursorinfo2[4] = $Pic1 Then

    MsgBox(0, "", "") ;******Hier

    EndIf

    ExitLoop

    EndIf

    Sleep(10)

    WEnd

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

    EndIf

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

    Sleep(10)
    WEnd

    [/autoit]
  • Ich denke das geht nicht ohne die Koordinaten des Bildes:

    local $mauskoordinate=GUIGetCursorInfo($GUI)
    local $x= $mauskoordinate[0]
    local $y= $mauskoordinate[1]

    select
    case $x <= $BildX + $BildBreite and $BildX <= $x and $y <= $BildY + $BildHoehe and $BildY <= $y
    Msgbox(0,"","bla")
    endselect