dazza Posted November 5, 2009 Share Posted November 5, 2009 I am working on an app that uses sub-windows - very much like Excel; where there are windows within a parent frame. My problem is how to maximise one of the sub-windows within the parent window. I have tried WinSetState(win_name, "", @SW_MAXIMISE) but this doesnt work; the parent window just takes on the name of the sub-window but the sub-window remains minimised. Any clues? Link to comment Share on other sites More sharing options...
Authenticity Posted November 5, 2009 Share Posted November 5, 2009 (edited) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hParent, $hChild Local $Edit $hParent = GUICreate("Parent", 500, 500) $hChild = GUICreate("", 300, 300, 100, 100, $WS_CHILD, $WS_EX_CLIENTEDGE, $hParent) GUICtrlCreateEdit("Edit control within child window", 25, 25, 250, 250, 0) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() GUISwitch($hParent) GUISetState() Sleep(1000) GUISetState(@SW_MAXIMIZE, $hChild) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Exit Edited November 5, 2009 by Authenticity Link to comment Share on other sites More sharing options...
martin Posted November 5, 2009 Share Posted November 5, 2009 I am working on an app that uses sub-windows - very much like Excel; where there are windows within a parent frame.My problem is how to maximise one of the sub-windows within the parent window. I have tried WinSetState(win_name, "", @SW_MAXIMISE) but this doesnt work; the parent window just takes on the name of the sub-window but the sub-window remains minimised.Any clues?Apart from the working example Authenticity showed, I assume that "@SW_MAXIMISE" is a typo.I tried creating child windows in various ways and used WinSetState to maximize them and couldn't find a way to fail so maybe there is something wrong with your code. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
dazza Posted November 9, 2009 Author Share Posted November 9, 2009 Many thanks for the response - and yes, being English we don't use Z's a lot. The example given by Authenticity doesn't apply as the code already names and defines the child window. All I have for my application-under-test is a sub-window name that doesnt respond to @SW_MAXIMIZE. I have found a key-press/menu fudge. It's not pretty and I'd still appreciate a solution if there is one... Link to comment Share on other sites More sharing options...
Authenticity Posted November 9, 2009 Share Posted November 9, 2009 Seems like I didn't understand the whole picture. Is this window is yours, you've coded it? or what? Link to comment Share on other sites More sharing options...
dazza Posted November 9, 2009 Author Share Posted November 9, 2009 The app is not mine. I have to use AutoIT to test it by navigating around it,clicking buttons, selecting menus (and winselectmenu doesn't work) and the like. Clearly this app is written by pixies and not using standard controls. C'est la Vie. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 9, 2009 Share Posted November 9, 2009 Is the window a WPF or Silverlight window? github.com/jvanegmond Link to comment Share on other sites More sharing options...
Authenticity Posted November 9, 2009 Share Posted November 9, 2009 This is an example of MDI application WinSpector: #include <WinAPI.au3> Run(@ProgramFilesDir & "\winspector\winspectorU.exe") WinWaitActive("Winspector - Welcome to Winspector") $hWnd = WinGetHandle("Winspector - Welcome to Winspector") $hCtrl = ControlGetHandle($hWnd, "", 65280) Sleep(2000) WinSetState($hCtrl, "", @SW_MAXIMIZE) 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