YoseMite Posted March 1, 2006 Posted March 1, 2006 Hey, I use this script: #include <GuiConstants.au3> GuiCreate("My message box", 400, 78,(@DesktopWidth-400)/2, (@DesktopHeight-78)/2, $WS_POPUP + $WS_DLGFRAME) $Button = GuiCtrlCreateButton("X", 370, 0, 30, 30) GUICtrlSetFont($Button, 24) $Label = GuiCtrlCreateLabel("", 0, 0, 370, 30 ) GUICtrlSetBkColor(-1,0x8080ff) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $Button ExitLoop EndSelect WEnd It works perfect but now I would move the GUI with my mouse... How can I do this? Greetz, YoseMite
BigDod Posted March 1, 2006 Posted March 1, 2006 Why not just use #include <GuiConstants.au3> GuiCreate("My message box", 400, 78,(@DesktopWidth-400)/2, (@DesktopHeight-78)/2) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd And you can move it anywhere you want. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
YoseMite Posted March 1, 2006 Author Posted March 1, 2006 (edited) Because I doesn't wanna to see the GUI. Edited March 1, 2006 by YoseMite
BigDod Posted March 1, 2006 Posted March 1, 2006 Because I doesn't wanna to see the GUI.What do you want to see Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
GaryFrost Posted March 1, 2006 Posted March 1, 2006 #include <GuiConstants.au3> $GUI = GUICreate("My message box", 400, 78, -1, -1, BitOR($WS_POPUPWINDOW, $WS_BORDER)) $Button = GUICtrlCreateButton("X", 370, 0, 30, 30) GUICtrlSetFont($Button, 24) $Label = GUICtrlCreateLabel("", 0, 0, 370, 30) GUICtrlSetBkColor(-1, 0x8080ff) $Label2 = GUICtrlCreateLabel("This is a test, this is only a test", 0, 30, 400, 48) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Button Exit Case $msg = $Label Or $msg = $Label2 _Drag($GUI) EndSelect WEnd Func _Drag($h_gui) DllCall("user32.dll", "int", "ReleaseCapture") DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0) EndFunc ;==>_Drag SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Moderators SmOke_N Posted March 1, 2006 Moderators Posted March 1, 2006 #include <GuiConstants.au3> $GUI = GUICreate("My message box", 400, 78, -1, -1, BitOR($WS_POPUPWINDOW, $WS_BORDER)) $Button = GUICtrlCreateButton("X", 370, 0, 30, 30) GUICtrlSetFont($Button, 24) $Label = GUICtrlCreateLabel("", 0, 0, 370, 30) GUICtrlSetBkColor(-1, 0x8080ff) $Label2 = GUICtrlCreateLabel("This is a test, this is only a test", 0, 30, 400, 48) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Button Exit Case $msg = $Label Or $msg = $Label2 _Drag($GUI) EndSelect WEnd Func _Drag($h_gui) DllCall("user32.dll", "int", "ReleaseCapture") DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0) EndFunc ;==>_DragAwesome!!, I was sitting here trying to mess with it, and had it moving, but constantly lost focus! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
YoseMite Posted March 1, 2006 Author Posted March 1, 2006 Thank you, this is exactly what I neet!! You're the best!
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