Jump to content

Parent and child GUI moving at the same time


Mingre
 Share

Recommended Posts

#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!

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