AoRaToS Posted January 11, 2013 Share Posted January 11, 2013 (edited) Hello everyone, I have noticed a weird behavior when using $WS_EX_MDICHILD. I create a main GUI with 2 buttons. Each button creates a new GUI. The first one without $WS_EX_MDICHILD. The second one with $WS_EX_MDICHILD. I click the first one and the other GUI is created (without $WS_EX_MDICHILD): If I drag the main GUI the other GUI is separate and doesn't move, which is expected. Then I click the second one for the next GUI to be created (with $WS_EX_MDICHILD): If I now drag the main GUI, both of the other GUIs move with it. If I close the second GUI, the first one still moves if I drag the main one. If I close the first one and re-open it, it still moves in relation to the Main GUI (if I drag the main GUI it follows) Is this how it's supposed to be? Does the style affect all GUIs created even without the style? Here is a script to try it out: (Follow the instructions above) expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 0) Global $Main MainGUI() Func MainGUI() $Main = GUICreate("Main", 350, 350) GUISetOnEvent($GUI_EVENT_CLOSE, "WindowClose") $button1 = GUICtrlCreateButton("Child 1 - no MDI_CHILD", 75, 100, 150, 20) GUICtrlSetOnEvent($button1, "Child1") $button2 = GUICtrlCreateButton("Child 2 - with MDI", 75, 150, 150, 20) GUICtrlSetOnEvent($button2, "Child2") GUISetState(@SW_SHOW, $Main) EndFunc Func Child1() $ChildGUI1 = GUICreate("Child 1 - no MDI_CHILD", 180, 180, 100, 100, Default, Default, $Main) GUISetOnEvent($GUI_EVENT_CLOSE, "WindowClose") GUISetState(@SW_SHOW, $ChildGUI1) EndFunc Func Child2() $ChildGUI2 = GUICreate("Child 2 - with MDI", 180, 180, 100, 100, Default, $WS_EX_MDICHILD, $Main) GUISetOnEvent($GUI_EVENT_CLOSE, "WindowClose") GUISetState(@SW_SHOW, $ChildGUI2) EndFunc Func WindowClose() GUIDelete(@GUI_WinHandle) If @GUI_WinHandle = $Main Then Exit EndIf EndFunc While 1 Sleep(100) WEnd I know the example can be coded better (e.g. one function for both GUIs and using @GUI_CTRLHANDLE but this does the job for now) Edited January 11, 2013 by AoRaToS s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2013 Moderators Share Posted January 12, 2013 AoRaToS,The child GUIs are created with exactly the same style and extended style values and these do not change as the GUIs are deleted and recreated. The Help file does tell us that the $WS_EX_MDICHILD style is not true MDI - so I can only imagine that AutoIt is doing something "under the hood" to get the child to follow the main GUI and this affects all children. I will ask trancexx to pop in and take a look - she will doubtless be able to give you the correct explanation. 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 Link to comment Share on other sites More sharing options...
trancexx Posted January 12, 2013 Share Posted January 12, 2013 It's a bug. Once one child window of that ex_style is created AutoIt thinks all the child windows are such. ...What can I say. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
AoRaToS Posted January 13, 2013 Author Share Posted January 13, 2013 (edited) I have opened a ticket in BugTracker #2300 to see if this will be fixed in an upcoming version! Edited January 13, 2013 by AoRaToS s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 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