CFire Posted April 9, 2007 Posted April 9, 2007 I have an issue with the parent-child styling where the child has almost a 'topmost' style to it by default and when the parent moves over it, it actually moves under it. I was wondering if there is a way to fix this to make the Parent the more dominant window. This is the way i am setting up the parent and child gui's. $Parent = GUICreate("Parent",200, 200) GUISetState (@SW_SHOW) $Child = GUICreate("Child", 200, 200, 100, 100, -1, -1, $Parent) GUISetState (@SW_SHOW) [u]Scripts and UDF's[/u]WMMedia - UDF full of functions to Control Media Output.
joeyb1275 Posted April 9, 2007 Posted April 9, 2007 Yeah this is a good question. I'm having the same problem???
Zedna Posted April 9, 2007 Posted April 9, 2007 Not expert with this but at least idea: change Z-Order of your windows (see SetWindowPos API function) Resources UDF ResourcesEx UDF AutoIt Forum Search
CFire Posted April 10, 2007 Author Posted April 10, 2007 I tried something but i'm not quite sure i did it right. do u have an example code that uses this function? [u]Scripts and UDF's[/u]WMMedia - UDF full of functions to Control Media Output.
socratessa Posted April 10, 2007 Posted April 10, 2007 (edited) Maybe this is what youre looking for. The code is using the extended options of the getmsg function. It give control to the child window and disables the parent I used $WS_SYSMENU,$WS_EX_TOOLWINDOW to disable all system window functions If you want those enabled you must add the proper handling of it in the code #include <GUIConstants.au3> $gui=GUICreate("Parent", 300, 300) $button=GUICtrlCreateButton("test",10,10,100,15) GUISetState(@SW_SHOW) do $msg = GUIGetMsg() Select Case $msg = $button WinSetState($gui,"",@SW_DISABLE) $guichild=GUICreate("Child",200,200,-1,-1,$WS_SYSMENU,$WS_EX_TOOLWINDOW) GUISetState(@SW_SHOW,$guichild) do $childmsg = GUIGetMsg(1) if not WinActive($guichild) and Winactive($gui) Then winactivate($guichild) until $childmsg[0] = $GUI_EVENT_CLOSE and $childmsg[1] = $guichild WinSetState($gui,"",@SW_ENABLE) GUIDelete($guichild) EndSelect until $msg = $GUI_EVENT_CLOSE Edited April 10, 2007 by socratessa Dont cry tomorrow about what you should have done yesterday. Just do it now.
CFire Posted April 10, 2007 Author Posted April 10, 2007 That script deactivates the parent while being able to work on the child. I was looking for something that makes both the parent and child able to be used but when you drag the parent window over the child it actually goes over it not under it. This Script is an example of what im talking about where the child gui is always above the parent gui. I dont know how to fix it. #include <GUIConstants.au3> Dim $msg $Parent=GUICreate("Parent", 200, 100) GUISetState(@SW_SHOW) $Child = GUICreate("Child", 200, 100, -1, @DesktopHeight/2, 0, 0, $Parent) GUISetState(@SW_SHOW) While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() WEnd [u]Scripts and UDF's[/u]WMMedia - UDF full of functions to Control Media Output.
therks Posted April 12, 2007 Posted April 12, 2007 As far as I know that's just how parent/child windows work. Is there any particular reason you need to have the windows setup this way? Could you not just use two unrelated windows? My AutoIt Stuff | My Github
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