I have problem with this code :
AutoIt
#include #include #include #include Opt("GUIOnEventMode", 1) Global $Width = 322, $Height = 183, $mWidth = 259, $mHeight = 106, $Title = "Main GUI" _Main() Func _Main() Global $GUI = GUICreate($Title, $Width, $Height, -1, -1, -1) Global $Show = GUICtrlCreateButton("Show multi GUI", 88, 64, 131, 57) GUISetState(@SW_SHOW) GUICtrlSetOnEvent($Show , "MultiGUI") GUISetOnEvent($GUI_EVENT_CLOSE , "Exit1") GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "On_Drag1") EndFunc Func MultiGUI() $Pos = WinGetPos($Title, "") ; If @DesktopWidth - ($Pos[0] + $Width) < $mWidth Then $mLeft = $Pos[0] - $mWidth - 40 ElseIf $Pos[0] < $mWidth Then $mLeft = $Pos[0] + $Width + 40 Else $mLeft = $Pos[0] + $Width + 40 EndIf ; GUISetState(@SW_DISABLE, $GUI) Global $mGUI = GUICreate("Multi GUI", $mWidth, $mHeight, $mLeft, $Pos[1], BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX), $WS_EX_OVERLAPPEDWINDOW, $GUI) GUISetState(@SW_SHOW, $mGUI) GUISetOnEvent($GUI_EVENT_CLOSE , "Exit2") GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "On_Drag2") EndFunc Func On_Drag1() Const $SC_DRAGMOVE = 0xF012 _SendMessage($GUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc Func On_Drag2() Const $SC_DRAGMOVE = 0xF012 _SendMessage($mGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc
When multi GUI is opened, I click anywhere on main GUI, it also move multi GUI.
I can't find the way, can you tell me the solutions? Thank you
Edited by MrVietA2, 07 July 2012 - 04:36 AM.






