Fläche auf z.B. Desktop auswählen und Korrdinaten auslesen

  • Meinst du so etwas?

    [autoit]

    #include <Misc.au3>

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

    Global $hDLL = DllOpen ("user32.dll")
    HotKeySet ("{ESC}", "_End")

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

    While True
    Select
    Case _IsPressed ("01", $hDLL)
    $a_Pos = MouseGetPos ()
    While _IsPressed ("01", $hDLL)
    Sleep (10)
    WEnd
    $a__Pos = MouseGetPos ()
    MsgBox (64, "Koordinaten", $a_Pos[0] &" x "& $a_Pos[1] &@CRLF& $a__Pos[0] &" x "& $a__Pos[1])
    EndSelect
    WEnd

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

    Func _End ()
    DllClose ($hDLL)
    Exit
    EndFunc

    [/autoit]
  • Ein Ausahl bräuchte ich, sodass der User sieht, wo er angegangen ist und wo er das Ende hat.

    Also so ähnlich wie auf dem Bild oben

  • [autoit]

    #include <Misc.au3>

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

    Global $hDLL = DllOpen ("user32.dll")
    HotKeySet ("{ESC}", "_End")

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

    While True
    Select
    Case _IsPressed ("01", $hDLL)
    $a_Pos = MouseGetPos ()
    While _IsPressed ("01", $hDLL)
    Sleep (10)
    WEnd
    $a__Pos = MouseGetPos ()
    If $a__Pos[0] >= $a_Pos[0] And $a__Pos[1] >= $a_Pos[1] Then
    $hGUI = GUICreate ("", $a__Pos[0] - $a_Pos[0], $a__Pos[1] - $a_Pos[1], $a_Pos[0], $a_Pos[1], 0x80880000)
    GUISetBkColor (0xA8CAEC, $hGUI)
    GUICtrlCreateGraphic(0, 0, $a__Pos[0] - $a_Pos[0], $a__Pos[1] - $a_Pos[1])
    GUICtrlSetBkColor(-1, 0x3399ff)
    GUICtrlCreateGraphic(1, 0, $a__Pos[0] - $a_Pos[0] - 3, $a__Pos[1] - $a_Pos[1] - 2)
    GUICtrlSetBkColor(-1, 0x3399ff)
    ElseIf $a_Pos[0] >= $a__Pos[0] And $a_Pos[1] >= $a__Pos[1] Then
    $hGUI = GUICreate ("", $a_Pos[0] - $a__Pos[0], $a_Pos[1] - $a__Pos[1], $a__Pos[0], $a__Pos[1], 0x80880000)
    GUISetBkColor (0xA8CAEC, $hGUI)
    GUICtrlCreateGraphic(0, 0, $a_Pos[0] - $a__Pos[0], $a_Pos[1] - $a__Pos[1])
    GUICtrlSetBkColor(-1, 0x3399ff)
    GUICtrlCreateGraphic(1, 0, $a_Pos[0] - $a__Pos[0] - 3, $a_Pos[1] - $a__Pos[1] - 2)
    GUICtrlSetBkColor(-1, 0x3399ff)
    ElseIf $a_Pos[0] >= $a__Pos[0] And $a__Pos[1] >= $a_Pos[1] Then
    $hGUI = GUICreate ("", $a_Pos[0] - $a__Pos[0], $a__Pos[1] - $a_Pos[1], $a__Pos[0], $a_Pos[1], 0x80880000)
    GUISetBkColor (0xA8CAEC, $hGUI)
    GUICtrlCreateGraphic(0, 0, $a_Pos[0] - $a__Pos[0], $a_Pos[1] - $a__Pos[1])
    GUICtrlSetBkColor(-1, 0x3399ff)
    GUICtrlCreateGraphic(1, 0, $a_Pos[0] - $a__Pos[0] - 3, $a_Pos[1] - $a__Pos[1] - 2)
    GUICtrlSetBkColor(-1, 0x3399ff)
    ElseIf $a_Pos[0] <= $a__Pos[0] And $a_Pos[1] >= $a__Pos[1] Then
    $hGUI = GUICreate ("", $a__Pos[0] - $a_Pos[0], $a_Pos[1] - $a__Pos[1], $a_Pos[0], $a__Pos[1], 0x80880000)
    GUISetBkColor (0xA8CAEC, $hGUI)
    GUICtrlCreateGraphic(0, 0, $a__Pos[0] - $a_Pos[0], $a_Pos[1] - $a__Pos[1])
    GUICtrlSetBkColor(-1, 0x3399ff)
    GUICtrlCreateGraphic(1, 0, $a__Pos[0] - $a_Pos[0] - 3, $a_Pos[1] - $a__Pos[1] - 2)
    GUICtrlSetBkColor(-1, 0x3399ff)
    EndIf
    WinSetTrans ($hGUI, "", 128)
    WinSetOnTop ($hGUI, "", 1)
    GUISetState (@SW_SHOW, $hGUI)
    MsgBox (64, "Koordinaten", $a_Pos[0] &" x "& $a_Pos[1] &@CRLF& $a__Pos[0] &" x "& $a__Pos[1])
    _End ()
    EndSelect
    WEnd

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

    Func _End ()
    DllClose ($hDLL)
    Exit
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von $var (8. Januar 2012 um 16:14)