CodeTinkerer

MDI Child of Child Window

4 posts in this topic

Hello,

I have been working on an application for quite some time now that involves an MDI style setup. I am running into an Issue with custom graphics as a background with static positions for custom buttons as a "tool bar".

When a child window is maximized it will maximize the entire inside region of the parent window as it should. I would like to set a custom region which a child window will maximize to so that it does not cover up my toolbar.

My first thought on the approach was to create another GUI as a container for all the child windows. which would also mean it would too be a child of the parent window. is this achievable?

 

Does anyone have any examples of what I am trying to achieve?

Share this post


Link to post
Share on other sites



CodeTinkerer

This should give you an idea

#AutoIt3Wrapper_Run_AU3Check=n
#include <array.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <GuiConstants.au3>
#include <Color.au3>
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GuiComboBox.au3>




Global Const $width = 700
Global Const $height = 400
Global $hGUI, $hWnd, $hGraphic, $ParticleBitmap, $ParticleBuffer, $hBrush0, $Brush, $hBrush2, $Pen


$Main_GUI = GUICreate("Main", @DeskTopWidth,@DeskTopHeight,0, 0,  $WS_POPUP)
GUISetBkColor (0x666699, $Main_GUI )
GUISetState(@SW_SHOW, $Main_GUI)

$Child1_GUI = GUICreate("Child", 1366*2, 768*2, 0, 0, $WS_CHILD, -1, $Main_GUI)
GUISetBkColor (0x33334C, $Child1_GUI )
GUISetState(@SW_SHOW, $Child1_GUI)



Global $Child2_GUI = GUICreate("Child2", 600, 380, 506, 150, $WS_POPUP)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child2_GUI), "hwnd", WinGetHandle($Child1_GUI))
GUISetState(@SW_SHOW, $Child2_GUI)
$location=WinGetPos("Child2")
$Btn_Test = GUICtrlCreateButton("Test", 10, 10, 90, 20)





Global $Child2_GUIlabels = GUICreate("Child3", 100, 380, 1100, 150, $WS_POPUP)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child2_GUIlabels), "hwnd", WinGetHandle($Child1_GUI))
GUISetState(@SW_SHOW, $Child2_GUIlabels)



while 1



    wend

 

Share this post


Link to post
Share on other sites

CodeTinkerer

This should give you an idea

 

 

amazing this is just the way I was hoping it would work!! Thank you!

Share this post


Link to post
Share on other sites

Glad that could help you

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