InJuriesX Posted December 25, 2016 Posted December 25, 2016 example $Form1 = GUICreate("form1", 402, 178, 244, 153) GUISetState(@SW_SHOW) $MenuItem3 = GUICtrlCreateMenuItem("About ;", $MenuItem1) $Form2 = GUICreate("About ; ", 297, 144, 328, 312) GUISetState(@SW_SHOW) Click $MenuItem3 show form2 and {X} Exit form2 one
Moderators Melba23 Posted December 25, 2016 Moderators Posted December 25, 2016 InJuriesX, Read the help file for GUICtrlCreateMenuItem to see how to correctly action the menu item events. Reading the Managing Multiple GUIs tutorial in the Wiki will explain how to create and close the child GUI. Come back if you still have problems. M23 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
InJuriesX Posted December 25, 2016 Author Posted December 25, 2016 hi melba23 When you close the form2 is closed the first form1 Look at the picture
Moderators Melba23 Posted December 25, 2016 Moderators Posted December 25, 2016 InJuriesX, Did you read the tutorial to which I linked? Please post the code you used - see here how to do it. M23 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
InJuriesX Posted December 25, 2016 Author Posted December 25, 2016 expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;this my tools ;Speed Win by registry ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Speed Win InJuriesX", 402, 178, 244, 153) $Pic1 = GUICtrlCreatePic("D:\صصور\صور\Wallpapers-room_com___Minimal_Wood_3_by_dimage_1920x1200.jpg", 0, -8, 401, 185, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $Button1 = GUICtrlCreateButton("Speed Win", 120, 64, 169, 33, $WS_GROUP) GUISetState(@SW_SHOW) $MenuItem1 = GUICtrlCreateMenu("File ; ") $MenuItem4 = GUICtrlCreateMenuItem("Rest ; ", $MenuItem1) GUICtrlSetState(-1, $GUI_CHECKED) $MenuItem3 = GUICtrlCreateMenuItem("About ;", $MenuItem1) $MenuItem2 = GUICtrlCreateMenuItem("Exit ; ", $MenuItem1) #EndRegion ### END Koda GUI section ### ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;here code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Case $MenuItem3 $Form2 = GUICreate("About ; ", 297, 144, 328, 312) $Edit1 = GUICtrlCreateEdit("", 16, 16, 265, 97) GUICtrlSetData(-1, StringFormat("My Account ; \r\nyoutube ; injuries yemen\r\noovoo ; al_ko_oon\r\nEmail Gmail ; weaklyinjuries@gmail.com")) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Case $MenuItem2 Exit Case $Button1 ;here code EndSwitch WEnd
JohnOne Posted December 25, 2016 Posted December 25, 2016 Case $GUI_EVENT_CLOSE Exit What do you expect to happen here? Look up Exit in help file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
InJuriesX Posted December 25, 2016 Author Posted December 25, 2016 hi JohnOne I want to click the exit {X} in frome 2 and not out of form 1
careca Posted December 25, 2016 Posted December 25, 2016 We understand, as pointed out already, you should check the posted link. If you're too lazy, check this code: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() ; Create a GUI. Local $hGUI1 = GUICreate("Example GUI1") ; Create a button. Local $idButton1 = GUICtrlCreateButton("Button1", 10, 10, 80, 22) ; Display the GUI GUISetState(@SW_SHOW, $hGUI1) ; Create a GUI. Local $hGUI2 = GUICreate("Example GUI2", 300, 300) ; Create a button. Local $idButton2 = GUICtrlCreateButton("Button2", 10, 10, 80, 22) ; Display the GUI GUISetState(@SW_SHOW, $hGUI2) ; Initialize a Local variable. Local $aMsg = 0 While 1 ; Assign to $aMsg the advanced GUI messages. $aMsg = GUIGetMsg($GUI_EVENT_ARRAY) ; Switch from GUIs Switch $aMsg[1] Case $hGUI1 ; The event comes from the GUI1 ; Switch from event ID Switch $aMsg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $idButton1 MsgBox($MB_SYSTEMMODAL, "", "Button1 clicked.") EndSwitch Case $hGUI2 ; The event comes from the GUI2 ; Switch from event ID Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($hGUI2) Case $idButton2 MsgBox($MB_SYSTEMMODAL, "", "Button2 clicked.") EndSwitch EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI1) EndFunc ;==>Example There's also GUISetOnEvent but you'd have to change some code. Basic idea is you need to let the script know what window you want to close and use GUIDelete($Form2) Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
InJuriesX Posted December 25, 2016 Author Posted December 25, 2016 (edited) hi careca thank you and JohnOne and Melba23 thanks ,,, ; to all Edited December 25, 2016 by InJuriesX
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