pastl Posted January 20, 2006 Posted January 20, 2006 Hi together, is it possible to draw a rectangle during mouse movement and resize it all the time. Something like when the mouse left button is pressed start drawing it. I tried something like this: While 1 If _IsPressed("01", $UserDLL) Then Local $Start_Pos = MouseGetPos() ;~ While 1 ;~ Local $Mouse_Pos = MouseGetPos() ;~ Local $Ausschnitt ;~ GUICtrlDelete($Ausschnitt) ;~ $Ausschnitt = GUICtrlCreateLabel($Start_Pos[0], $Start_Pos[1], $Mouse_Pos[0], $Mouse_Pos[1], 0x1000) ;~ If Not _IsPressed("01", $UserDLL) Then ExitLoop ;~ WEnd ExitLoop EndIf WEnd Thanks for your help. pastl p.s. sorry for my english.
Thatsgreat2345 Posted January 20, 2006 Posted January 20, 2006 ummm why are there comments on every line?
pastl Posted January 20, 2006 Author Posted January 20, 2006 hello, ummm why are there comments on every line? if you mean these: ;~ While 1 ;~ Local $Mouse_Pos = MouseGetPos() ;~ Local $Ausschnitt ;~ GUICtrlDelete($Ausschnitt) ;~ $Ausschnitt = GUICtrlCreateLabel($Start_Pos[0], $Start_Pos[1], $Mouse_Pos[0], $Mouse_Pos[1], 0x1000) ;~ If Not _IsPressed("01", $UserDLL) Then ExitLoop ;~ WEnd They are not working. pastl
Thatsgreat2345 Posted January 21, 2006 Posted January 21, 2006 while im saying your code wont work if you comment that stuff thats just putting a comment its not code... or do u mean its not like that in the actual ill look at it and just remove the comments
upnorth Posted January 21, 2006 Posted January 21, 2006 expandcollapse popup#include <Misc.au3> #include <GUIConstants.au3> Opt( 'GUIOnEventMode', 1) $UserDLL = DllOpen("user32.dll") $gui = GUICreate( '') GUISetOnEvent( $GUI_EVENT_CLOSE, 'quit') GUISetState() While 1 draw_label() WEnd Func draw_label() Local $MouseCoordMode, $Start_Pos, $Ausschnitt, $Mouse_Pos While 1 If _IsPressed("01", $UserDLL) Then $MouseCoordMode = Opt( 'MouseCoordMode', 2) $Start_Pos = MouseGetPos() $Ausschnitt = GUICtrlCreateLabel( 'text...', 0, 0, 1, 1, $SS_SUNKEN) GUICtrlSetBkColor( $Ausschnitt, 0) While _IsPressed("01", $UserDLL) $Mouse_Pos = MouseGetPos() GUICtrlSetPos( $Ausschnitt, $Start_Pos[0], $Start_Pos[1], $Mouse_Pos[0] - $Start_Pos[0], $Mouse_Pos[1] - $Start_Pos[1]) Sleep( 10) WEnd Opt( 'MouseCoordMode', $MouseCoordMode) Return $Ausschnitt EndIf Sleep( 10) WEnd EndFunc Func quit() Exit EndFunc Func onautoitexit() DllClose( $UserDLL) EndFunc
pastl Posted January 21, 2006 Author Posted January 21, 2006 Hello UP NORTH, thanks for your help, this was wath i was looking for. Greatings pastl
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now