Jump to content

resize parent and child windows is possible


ra95
 Share

Recommended Posts

Hi gui

I have a little question for you.Is it possible resize parent and child windows together ,with drag

I have create a windows with imputbox on the right side and child windows in the left side with IE, when i resize the parent windows, the child windows not resize.

it's possible do this, and possible to ancor the child windows to the parent ?

Thx

for all suggest...

ra95

My code:

$ini = @WorkingDir & "\G_G.ini"
;~ $Tsys= @YEAR & "/" & @MON & "/" & @MDAY;Data di Sistema da confrontare
If Not FileExists($ini) Then;Se non esiste il file ini
FileOpen($ini, 2);Apro file in scrittura

$sDataMGS = "server_=" & '"6"'
IniWriteSection($ini,"[server_]",0);
IniWriteSection($ini, "server_", $sDataMGS,0);scrivo il link nel file .ini

$sDataMGL = "GL=" & '"Login G"'
IniWriteSection($ini,"[GL]",1);
IniWriteSection($ini, "GL", $sDataMGL,1);scrivo il link nel file .ini

$sDataMGP = "GP=" & '"Password G"'
IniWriteSection($ini,"[GP]",2);
IniWriteSection($ini, "GP", $sDataMGP,2);scrivo il link nel file .ini

$sDataFFL = "LFF=" & '"Login ForumFree"'
IniWriteSection($ini,"[LFF]",3);metto la section
IniWriteSection($ini, "LFF", $sDataFFL,3);scrivo il link nel file .ini

$sDataFFP = "PSWFF=" & '"Password ForumFree"'
IniWriteSection($ini,"[PSWFF]",4);metto la section
IniWriteSection($ini, "PSWFF", $sDataFFP,4)

fileclose($ini);Chiudo il file


$server = IniRead ( $ini, "server_","server_","")
$username = IniRead ( $ini, "GL","GL","")
$password = IniRead ( $ini, "GP","GP","")
$Log = IniRead ( $ini, "LFF","LFF","")
$Psw = IniRead ( $ini, "PSWFF","PSWFF","")

$Formx = GUICreate("G - "&$usr&" - Server "&$srvx, 641, 558, 193, 125,BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$IEGUI = GUICtrlCreateObj   ($oIE, 1, 1, 499, 199)
Global $Label1 = GUICtrlCreateLabel("Login G", 528, 8, 50, 17, $SS_CENTERIMAGE)
Global $username = GUICtrlCreateInput($usr, 528, 32, 100, 21)
Global $Label2 = GUICtrlCreateLabel("Password G", 528, 56, 70, 17, $SS_CENTERIMAGE)
Global $password = GUICtrlCreateInput($pas, 528, 80, 100, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
Global $Label3 = GUICtrlCreateLabel("Login ForumFree", 528, 112, 83, 17, $SS_CENTERIMAGE)
Global $Log = GUICtrlCreateInput($Lo, 528, 144, 100, 21)
Global $Label4 = GUICtrlCreateLabel("Password ForumFree", 528, 182, 103, 17)
Global $Psw = GUICtrlCreateInput($Ps, 528, 207, 100, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
Global $Label5 = GUICtrlCreateLabel("Server di G", 528, 240, 66, 17, $SS_CENTERIMAGE)
Global $server = GUICtrlCreateInput($srvx, 608, 240, 20, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))

$Activate = GUICtrlCreateButton("Go!!!", 597, 450, 28, 21)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Activate
FileOpen($ini, 2);Apro file in scrittura

$sDataMGS = Guictrlread ($server)
IniWriteSection($ini,"[server_]",0);
IniWriteSection($ini, "server_", "server_=" & '"'&$sDataMGS&'"',0);scrivo il link nel file .ini

$sDataMGL = GUICtrlRead ($username)
IniWriteSection($ini,"[GL]",1);
IniWriteSection($ini, "GL", "GL=" & '"' & $sDataMGL &'"',1);scrivo il link nel file .ini

$sDataMGP = GUICtrlRead ($password)
IniWriteSection($ini,"[GP]",2);
IniWriteSection($ini, "GP", "GP=" & '"' & $sDataMGP & '"',2);scrivo il link nel file .ini

$sDataFFL = GUICtrlRead ($Log); Scrivi nella dir %temp%
IniWriteSection($ini,"[LFF]",3);metto la section
IniWriteSection($ini, "LFF", "LFF=" & '"' & $sDataFFL &'"',3);scrivo il link nel file .ini

$sDataFFP = GUICtrlRead ($Psw); Scrivi nella dir %temp%
IniWriteSection($ini,"[PSWFF]",4);metto la section
IniWriteSection($ini, "PSWFF", "PSWFF=" & '"'& $sDataFFP &'"',4);scrivo il link nel file .ini

EndSelect
WEnd
Edited by ra95
Link to comment
Share on other sites

I didn't look at your script, but in case it helps here is an example I did for someone to resize child windows when th eparent is resized.

#include <GuiConstants.au3>
#include <windowsconstants.au3>

Const $SM_CXFIXEDFRAME = 7
Global Const $WM_ENTERSIZEMOVE = 0x231,$WM_EXITSIZEMOVE = 0x232
Global $guiWid = 500, $Guiht = 500
Global Const $WS_EX_COMPOSITED = 0x2000000
$Main_GUI = GUICreate("Main", 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED);, $WS_EX_LAYERED);$WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX
;$gamegui = GUICreate("QBC", 1280, 1024, -1, -1, $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX, $WS_EX_LAYERED)
GUISetBkColor(0xfffaf0, $Main_GUI)
GUISetState(@SW_SHOW, $Main_GUI)
$Btn_Exit = GUICtrlCreateButton("E&xit", 10, 10, 90, 20)
GUICtrlSetResizing(-1,BitOr($Gui_DOCKTOP,$GUI_DOCKLEFT,$GUI_DOCKWIDTH,$GUI_DOCKHEIGHT))

$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wtitle = $wtitle[0]
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)
$wside = $wside[0]
$childHt = ($GuiHt - 50)/2 - $wtitle - 2* $wside
$childWid = $GuiWid/2 - 2 * $wside

$Child1_GUI = GUICreate("Child1",$childWid, $childHt, 0, 50, $WS_CAPTION);,$WS_EX_LAYERED)
GUISetBkColor(0xffffff, $Child1_GUI)
$Btn_Test = GUICtrlCreateButton("Test", 10, 10, 90, 20)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child1_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child1_GUI)

$Child2_GUI = GUICreate("Child2", $childWid, $childHt, $GuiWid/2, 50);, $WS_POPUP)
GUISetBkColor(0x0ff0000, $Child2_GUI)
GUISetState($Child2_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child2_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child2_GUI)

$Child3_GUI = GUICreate("Child3", $childWid, $childHt, 0, 50 + $childHt + 2*$wside + $wtitle, $WS_CAPTION);,$WS_EX_LAYERED)
GUISetBkColor(0x00ff00, $Child3_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child3_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child3_GUI)

$Child4_GUI = GUICreate("Child4", $childWid, $childHt, $GuiWid/2, 50 +$childHt + 2*$wside + $wtitle);, $WS_POPUP)
GUISetBkColor(0x00000ff, $Child4_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child4_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child4_GUI)

GuiSwitch($Main_GUI)
GUIRegisterMsg($WM_SIZE, "SetChildrenToBed")
;GUIRegisterMsg($WM_ENTERSIZEMOVE,"ensm")
;GUIRegisterMsg($WM_EXITSIZEMOVE,"exsm")
Opt("mousecoordmode", 2)
$winact = ''

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Btn_Exit
            Exit
        Case $Btn_Test
            MsgBox(0, "Test", "Hit Button on Child Window")
    EndSwitch
    
    
WEnd

Func SetChildrenToBed($hWnd,$iMsg,$wparam,$lparam)
    Local $clientHt = BitAnd($lparam,0xffff)
    Local $clientWid = BitShift($lparam,16)
    WinMove($Child1_GUI,"",0,50,$clientHt/2,($clientWid-50)/2)
    WinMove($Child2_GUI,"",$clientHt/2,50,$clientHt/2,($clientWid-50)/2)
    WinMove($Child3_GUI,"",0,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2)
    WinMove($Child4_GUI,"",$clientHt/2,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2)
EndFunc
Func ensm()
GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED,$Main_GUI)    
EndFunc
func exsm()
    GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),-1,$Main_GUI)
EndFunc
Edited by martin
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

I didn't look at your script, but in case it helps here is an example I did for someone to resize child windows when th eparent is resized.

#include <GuiConstants.au3>
#include <windowsconstants.au3>

Const $SM_CXFIXEDFRAME = 7
Global Const $WM_ENTERSIZEMOVE = 0x231,$WM_EXITSIZEMOVE = 0x232
Global $guiWid = 500, $Guiht = 500
Global Const $WS_EX_COMPOSITED = 0x2000000
$Main_GUI = GUICreate("Main", 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED);, $WS_EX_LAYERED);$WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX
;$gamegui = GUICreate("QBC", 1280, 1024, -1, -1, $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX, $WS_EX_LAYERED)
GUISetBkColor(0xfffaf0, $Main_GUI)
GUISetState(@SW_SHOW, $Main_GUI)
$Btn_Exit = GUICtrlCreateButton("E&xit", 10, 10, 90, 20)
GUICtrlSetResizing(-1,BitOr($Gui_DOCKTOP,$GUI_DOCKLEFT,$GUI_DOCKWIDTH,$GUI_DOCKHEIGHT))

$wtitle = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CYCAPTION)
$wtitle = $wtitle[0]
$wside = DllCall('user32.dll', 'int', 'GetSystemMetrics', 'int', $SM_CXFIXEDFRAME)
$wside = $wside[0]
$childHt = ($GuiHt - 50)/2 - $wtitle - 2* $wside
$childWid = $GuiWid/2 - 2 * $wside

$Child1_GUI = GUICreate("Child1",$childWid, $childHt, 0, 50, $WS_CAPTION);,$WS_EX_LAYERED)
GUISetBkColor(0xffffff, $Child1_GUI)
$Btn_Test = GUICtrlCreateButton("Test", 10, 10, 90, 20)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child1_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child1_GUI)

$Child2_GUI = GUICreate("Child2", $childWid, $childHt, $GuiWid/2, 50);, $WS_POPUP)
GUISetBkColor(0x0ff0000, $Child2_GUI)
GUISetState($Child2_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child2_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child2_GUI)

$Child3_GUI = GUICreate("Child3", $childWid, $childHt, 0, 50 + $childHt + 2*$wside + $wtitle, $WS_CAPTION);,$WS_EX_LAYERED)
GUISetBkColor(0x00ff00, $Child3_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child3_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child3_GUI)

$Child4_GUI = GUICreate("Child4", $childWid, $childHt, $GuiWid/2, 50 +$childHt + 2*$wside + $wtitle);, $WS_POPUP)
GUISetBkColor(0x00000ff, $Child4_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($Child4_GUI), "hwnd", WinGetHandle($Main_GUI))
GUISetState(@SW_SHOW, $Child4_GUI)

GuiSwitch($Main_GUI)
GUIRegisterMsg($WM_SIZE, "SetChildrenToBed")
;GUIRegisterMsg($WM_ENTERSIZEMOVE,"ensm")
;GUIRegisterMsg($WM_EXITSIZEMOVE,"exsm")
Opt("mousecoordmode", 2)
$winact = ''

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Btn_Exit
            Exit
        Case $Btn_Test
            MsgBox(0, "Test", "Hit Button on Child Window")
    EndSwitch
    
    
WEnd

Func SetChildrenToBed($hWnd,$iMsg,$wparam,$lparam)
    Local $clientHt = BitAnd($lparam,0xffff)
    Local $clientWid = BitShift($lparam,16)
    WinMove($Child1_GUI,"",0,50,$clientHt/2,($clientWid-50)/2)
    WinMove($Child2_GUI,"",$clientHt/2,50,$clientHt/2,($clientWid-50)/2)
    WinMove($Child3_GUI,"",0,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2)
    WinMove($Child4_GUI,"",$clientHt/2,50 + ($clientWid-50)/2,$clientHt/2,($clientWid-50)/2)
EndFunc
Func ensm()
GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),$WS_EX_COMPOSITED,$Main_GUI)    
EndFunc
func exsm()
    GUISetStyle( BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPSIBLINGS),-1,$Main_GUI)
EndFunc
Thanks Martin, your script is very exellent.!!!

Antonio

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...