Sign in to follow this  
Followers 0
dazza

Subwindows - maximising them?

8 posts in this topic

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Authenticity

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

Seems like I didn't understand the whole picture. Is this window is yours, you've coded it? or what?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0