TinyHacker Posted June 26, 2010 Share Posted June 26, 2010 (edited) Hello bros! Can u please tell me how can i make the "button" and the "pic" able to move the window when i drag them? i mean to let the "button" and the "pic" just like the "window frame" can move the window by dragging them! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Help!", 153, 148, 279, 169) $Button1 = GUICtrlCreateButton("drag me to move the window", 8, 24, 137, 49, BitOR($BS_MULTILINE,$WS_GROUP)) GUICtrlSetCursor (-1, 0) $Pic1 = GUICtrlCreatePic("", 8, 88, 137, 49, BitOR($SS_NOTIFY,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS)) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd please it's important .... thanx! Edited June 26, 2010 by TinyHacker Link to comment Share on other sites More sharing options...
Yoriz Posted June 26, 2010 Share Posted June 26, 2010 Hi, You can use '$GUI_WS_EX_PARENTDRAG', works on the label but i dont think it works on buttons. For the button you might have to do some detect a mouseleftdown and if mouse moves before mouseleftup then move the window to follow mouse, else carryout button click im just guessing on how you could do it though . #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form= $Form2 = GUICreate("Help!", 153, 148, 279, 169) $Button1 = GUICtrlCreateButton("drag me to move the window", 8, 24, 137, 49, BitOR($BS_MULTILINE,$WS_GROUP),$GUI_WS_EX_PARENTDRAG) GUICtrlSetCursor (-1, 0) $Pic1 = GUICtrlCreatePic("", 8, 88, 137, 49, BitOR($SS_NOTIFY,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS),$GUI_WS_EX_PARENTDRAG) GUICtrlSetCursor (-1, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
TinyHacker Posted June 26, 2010 Author Share Posted June 26, 2010 Thank u Yoriz !! Ya it really worked as i wanted it to be! , no need to do the same with the button, than's enough for me thanx bro! Link to comment Share on other sites More sharing options...
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