Sign in to follow this  
Followers 0
Mingre

Parent and child GUI moving at the same time

5 posts in this topic

#include 

Local $aMove[2]
$hParent = GUICreate('Parent')
$hChild = GUICreate('Child', -1, -1, 0, 0, -1, -1, $hParent)

GUISetState(@SW_SHOW, $hParent)
GUISetState(@SW_SHOW, $hChild)

$aPrevPOS = WinGetPos($hChild)
Do
$ChildPOS = WinGetPos($hChild);Sleep(250)
If $ChildPOS[0] <> $aPrevPOS[0] Or $ChildPOS[1] <> $aPrevPOS[1] Then
$aMove[0] = $ChildPOS[0] - $aPrevPOS[0]
$aMove[1] = $ChildPOS[1] - $aPrevPOS[1]
$ParentPOS = WinGetPos($hParent)
WinMove($hParent, '', $ParentPOS[0] + $aMove[0], $ParentPOS[1] + $aMove[1])
$aPrevPOS = WinGetPos($hChild)
EndIf

Until GUIGetMsg() = $GUI_EVENT_CLOSE

What should I add to make the child GUI move as the parent GUI is moved?

Thanks!

Share this post


Link to post
Share on other sites



Hi,

Take a look at the $WS_EX_MDICHILD exstyle.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hello FireFox,

Thank you so much!

Share this post


Link to post
Share on other sites

You're welcome ;) Don't forget to make a forum search next time, I'm pretty sure it was already asked.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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