GameOver1 Posted January 28, 2020 Share Posted January 28, 2020 I am making a program and I did a multi windows they are opening OK but when I close the mini window all the program closes expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIconstants.au3> #NoTrayIcon gui1() Global $guipickf = GUICreate("Pick", 200, 180, -1, -1, -1, $WS_EX_TOPMOST) Global $guipickt =GUICreate("Pick", 200, 180, -1, -1, -1, $WS_EX_TOPMOST) Func gui1() HotKeySet("{esc}","myExit") Global $dwf1 = GUICreate("Asda", 275, 175, 342, 292) Global $brun = GUICtrlCreateButton("Run", 96, 144, 75, 25, $BS_DEFPUSHBUTTON) Global $tx2 = GUICtrlCreateInput("", 104, 80, 57, 21) $rec = GUICtrlCreateLabel("Hunt Area", 88, 8, 104, 28) GUICtrlSetFont(-1, 18, 400, 0, "MS UI Gothic") GUICtrlSetColor(-1, 0x000000) Global $ty2 = GUICtrlCreateInput("", 208, 80, 57, 21) $recx = GUICtrlCreateLabel("X :", 72, 80, 26, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Label1 = GUICtrlCreateLabel("Y :", 176, 80, 26, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) Global $tmc = GUICtrlCreateInput("", 136, 112, 97, 21) Global $tx1 = GUICtrlCreateInput("", 104, 48, 57, 21) Global $ty1 = GUICtrlCreateInput("", 208, 48, 57, 21) $Label3 = GUICtrlCreateLabel("X :", 72, 48, 26, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Label4 = GUICtrlCreateLabel("Y :", 176, 48, 26, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $posf = GUICtrlCreateButton("From", 8, 48, 51, 21, $BS_DEFPUSHBUTTON) $post = GUICtrlCreateButton("To", 8, 80, 51, 21, $BS_DEFPUSHBUTTON) $mcp = GUICtrlCreateButton("Monster Color", 32, 112, 83, 21, $BS_DEFPUSHBUTTON) GUISetState(@SW_SHOW) Local $aMsg While 1 $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array Switch $aMsg[1] ; check which GUI sent the message Case $dwf1 Switch $aMsg[0] ; Now check for the messages for $hGUI1 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we exit <<<<<<<<<<<<<<< ExitLoop Case $posf GUICtrlSetState($posf, $GUI_DISABLE) runposf() Case $post GUICtrlSetState($post, $GUI_DISABLE) runpost() EndSwitch Case $guipickf Switch $aMsg[0] ; Now check for the messages for $g_hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($guipickf) GUICtrlSetState($posf, $GUI_ENABLE) EndSwitch Case $guipickt Switch $aMsg[0] ; Now check for the messages for $g_hGUI2 Case $GUI_EVENT_CLOSE ; If we get the CLOSE message from this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUIDelete($guipickt) GUICtrlSetState($post, $GUI_ENABLE) EndSwitch EndSwitch WEnd EndFunc ;==>gui1 Func runposf() HotKeySet("{p}", "pickposf") Global $guipickf = GUICreate("Pick", 200, 180, -1, -1, -1, $WS_EX_TOPMOST) GUICtrlCreateLabel("Mouse Coord.:", 10, 10) Global $MousePos=GUICtrlCreateInput("", 100, 10, 90, 20, $ES_READONLY) GUICtrlCreateLabel("Decimal Code: ", 10, 40) Global $PixelColor=GUICtrlCreateInput("", 100, 40, 90, 20, $ES_READONLY) GUICtrlCreateLabel("Hex Code:", 10, 70) Global $hexColor=GUICtrlCreateInput("", 100, 70, 90, 20,$ES_READONLY) GUICtrlCreateLabel("Color:", 10, 100) Global $MostrarColor=GUICtrlCreateLabel("", 100, 100, 90, 20,$ES_READONLY) GUICtrlCreateLabel("Press P to Pick Position/Color.", 0, 140 ,200, 15, $SS_CENTER) GUICtrlSetColor(-1,0x00808080) GUISetState() While 1 $msg=GUIGetMsg() While 1 Sleep(25) Global $pos=MouseGetPos() $color=PixelGetColor($pos[0],$pos[1]) GUICtrlSetData($MousePos,"X="&$pos[0]&" Y="&$pos[1]) GUICtrlSetData($PixelColor,$color) $HEX6=StringRight(Hex($color),6) GUICtrlSetData($hexColor,"#"&$HEX6) GUICtrlSetBkColor($MostrarColor,"0x"&Hex($color)) WEnd ; We can only get messages from the second GUI Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($guipickf) ExitLoop EndSwitch WEnd EndFunc ;==>gui2 Func runpost() #include <GUIconstants.au3> #NoTrayIcon Global $Paused HotKeySet("{p}", "pickpost") Global $guipickt =GUICreate("Pick", 200, 180, -1, -1, -1, $WS_EX_TOPMOST) GUICtrlCreateLabel("Mouse Coord.:", 10, 10) Global $MousePos=GUICtrlCreateInput("", 100, 10, 90, 20, $ES_READONLY) GUICtrlCreateLabel("Decimal Code: ", 10, 40) Global $PixelColor=GUICtrlCreateInput("", 100, 40, 90, 20, $ES_READONLY) GUICtrlCreateLabel("Hex Code:", 10, 70) Global $hexColor=GUICtrlCreateInput("", 100, 70, 90, 20,$ES_READONLY) GUICtrlCreateLabel("Color:", 10, 100) Global $MostrarColor=GUICtrlCreateLabel("", 100, 100, 90, 20,$ES_READONLY) GUICtrlCreateLabel("Press P to Pick Position/Color.", 0, 140 ,200, 15, $SS_CENTER) GUICtrlSetColor(-1,0x00808080) GUISetState() While 1 $msg=GUIGetMsg() While 1 Sleep(25) Global $pos=MouseGetPos() $color=PixelGetColor($pos[0],$pos[1]) GUICtrlSetData($MousePos,"X="&$pos[0]&" Y="&$pos[1]) GUICtrlSetData($PixelColor,$color) $HEX6=StringRight(Hex($color),6) GUICtrlSetData($hexColor,"#"&$HEX6) GUICtrlSetBkColor($MostrarColor,"0x"&Hex($color)) WEnd While 1 ; We can only get messages from the second GUI Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($guipickt) ExitLoop EndSwitch WEnd WEnd EndFunc Func myExit() Exit EndFunc Func pickposf() GUICtrlSetData($tx1,$pos[0]) GUICtrlSetData($ty1,$pos[1]) EndFunc Func pickpost() GUICtrlSetData($tx2,$pos[0]) GUICtrlSetData($ty2,$pos[1]) EndFunc Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 28, 2020 Moderators Share Posted January 28, 2020 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 28, 2020 Moderators Share Posted January 28, 2020 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts