the123punch Posted October 30, 2008 Share Posted October 30, 2008 Hi all, I have a GUI that has a main window from which a child window is created. For the child window, I want to be able to place always close to its parent window (like for example to its right or to its left), so I need to be able to get the top and left positions of the parent window to give it to the child window when I create it. I also want to have that child window modal when it pops up so that the user has to read it and close it before continuing. Is there a possibilty to do that in AutoIt? Is there any windows GUI styles that I should be using? Thanks for the help. the123punch jvds 1 Link to comment Share on other sites More sharing options...
maqleod Posted October 30, 2008 Share Posted October 30, 2008 Hi all,I have a GUI that has a main window from which a child window is created. For the child window, I want to be able to place always close to its parent window (like for example to its right or to its left), so I need to be able to get the top and left positions of the parent window to give it to the child window when I create it.I also want to have that child window modal when it pops up so that the user has to read it and close it before continuing.Is there a possibilty to do that in AutoIt? Is there any windows GUI styles that I should be using?Thanks for the help.the123punchwingetpos() in order to find the parent and adjust the child accordingly jvds 1 [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
oMBRa Posted October 31, 2008 Share Posted October 31, 2008 here and example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate('Main GUI', 400, 300) $Button = GUICtrlCreateButton('click', 50, 100, 50) $hPOS = WinGetPos($hGUI) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then Exit If $Msg = $Button Then $hCHILD = GUICreate("Child", 169, 68, $hPOS[0] + $hPOS[2], $hPOS[1], -1, -1, $hGUI) GUISetState() EndIf WEnd jvds 1 Link to comment Share on other sites More sharing options...
elpresident3 Posted October 31, 2008 Share Posted October 31, 2008 If you want to give your GUI Child the123punch then use this code to keep the child moving with the parent. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hPOS, $hPOS2 $hGUI = GUICreate('Main GUI', 400, 300) $Button = GUICtrlCreateButton('click', 50, 100, 50) $hPOS = WinGetPos($hGUI) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then Exit Select Case $Msg = $Button $hPOS = WinGetPos($hGUI) $hCHILD = GUICreate("Child", 169, 68, $hPOS[0] + $hPOS[2], $hPOS[1], -1, -1, $hGUI) GUISetState() Case $Msg = $GUI_EVENT_PRIMARYUP $hPOS2 = WinGetPos($hGUI) WinMove($hCHILD,"Child",$hPOS2[0] + $hPOS2[2] , $hPOS2[1]) EndSelect WEnd jvds 1 Link to comment Share on other sites More sharing options...
the123punch Posted October 31, 2008 Author Share Posted October 31, 2008 Thank you all! Greatly appreciate your help! Cheers. the123punch jvds 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now