Hawkwing Posted March 24, 2009 Share Posted March 24, 2009 Simple question, when you create a child GUI, how do you center it over it's parent? The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
Authenticity Posted March 24, 2009 Share Posted March 24, 2009 Getting the parent width/2 minus the child's width/2, same for height. Correct? Link to comment Share on other sites More sharing options...
Hawkwing Posted March 24, 2009 Author Share Posted March 24, 2009 But then if you can move the parent gui around, then it will put the child gui where the parent started, not where it is now. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
Authenticity Posted March 24, 2009 Share Posted March 24, 2009 (edited) So handle the parent WM_MOVE event. You can also check, if the child may not exist always, if $hChild is pointing to an existing window handle, If IsHWnd($hChild) Then move the window.Edit Maybe using MDI is the proper way to go? Edited March 24, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Hawkwing Posted March 24, 2009 Author Share Posted March 24, 2009 Thanks, I'm not really sure how handle the parent wm_move event, but when I put $WS_EX_MDICHILD in the exStyle section, it worked. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. 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