Rodger Posted November 28, 2008 Share Posted November 28, 2008 (edited) Hello, I have made a main Window with a menu-item. Every time I click on the menu-item it opens a new window which should be the case. But .... when I close one of windows which was opened by the menu-item, it closes everything in stead of only that specific one. How can I solve this, it would be nice if you can give me an example. Thxs, Rodger Edited November 28, 2008 by Rodger Link to comment Share on other sites More sharing options...
KaFu Posted November 28, 2008 Share Posted November 28, 2008 You have something like If $msg = $GUI_EVENT_CLOSE Then ExitLoop or If $msg = $GUI_EVENT_CLOSE Then Exit in you script. Both GUIs sent the $GUI_EVENT_CLOSE while closing, so you have to enhance that part to something like If $msg = $GUI_EVENT_CLOSE Then if WinActive($GUI_Main) then exit else guidelete($GUI_Menu) endif endif Hard to say the syntax needed without a sample OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Rodger Posted November 28, 2008 Author Share Posted November 28, 2008 (edited) I was a little bit to quick. The moment I closed one of the extra opened window, I can't close the other extra opened window(s) any more because the Gui has been deleted. Next to that, it closes always the first extra opened window and not the window you want to close. Edited November 28, 2008 by Rodger Link to comment Share on other sites More sharing options...
Rodger Posted November 28, 2008 Author Share Posted November 28, 2008 I found the solution: The last GuiDelete() should be : GUIDelete(WinGetHandle(WinGetTitle(""))) 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