AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Function] PopupXY v0.4 - Calculate X/Y Of Pop-Up Window

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
jballi



Joined: 01 Oct 2005
Posts: 747
Location: Texas, USA

PostPosted: Sat Jul 07, 2007 2:12 am    Post subject: [Function] PopupXY v0.4 - Calculate X/Y Of Pop-Up Window Reply with quote

Introduction
They say that necessity is the mother of invention. I needed a way of calculating the coordinates of a pop-up window so that it would be centered relative to the parent window. I checked the forum and the documentation but couldn't find anything like it so I created a simple function to do it for me.


The Code

Final Thoughts
I named the function PopupXY for lack of better name. If you can think of a better name, let me know.

I hope that someone finds this useful.

---------------------------------------------------------------------------
v0.1
First draft.

v0.2
Updated examples.

v0.3
- p_ParentWinTitle and p_ChildWinTitle parameters renamed to p_Parent and p_Child respectively. These parameters can now contain a GUI window number (1 to 99) as well as a window title, See the documentation for more information.
- Updated examples.

v0.4
- The p_Parent and p_Child parameters can now contain a window handle (hWnd). See the documentation for more information.
- The r_ChildX and r_ChildY parameters are now optional.
- The function now returns the calculated coordinates for the child window. See the documentation for more information.
- Updated examples.


Last edited by jballi on Mon Jul 11, 2011 5:50 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
jballi



Joined: 01 Oct 2005
Posts: 747
Location: Texas, USA

PostPosted: Fri Jul 20, 2007 8:54 pm    Post subject: Reply with quote

Minor update. See the bottom of the top post for more information.
Back to top
View user's profile Send private message Send e-mail
jballi



Joined: 01 Oct 2005
Posts: 747
Location: Texas, USA

PostPosted: Mon Jul 11, 2011 5:54 am    Post subject: Reply with quote

v0.4
Minor changes. See the bottom of the top post for more information.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group