AutoHotkey Community

It is currently May 25th, 2012, 10:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 7th, 2007, 3:12 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 772
Location: Texas, USA
Introduction
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 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.

v2.0
- Added new p_Position parameter to specify where the child window is to be positioned relative to the parent. The default is "Center". See the documentation for more information.
- Updated examples.


Last edited by jballi on March 9th, 2012, 7:27 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 20th, 2007, 9:54 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 772
Location: Texas, USA
Minor update. See the bottom of the top post for more information.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 11th, 2011, 6:54 am 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 772
Location: Texas, USA
v0.4
Minor changes. See the bottom of the top post for more information.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2012, 7:51 pm 
Offline

Joined: October 1st, 2005, 9:55 pm
Posts: 772
Location: Texas, USA
There is not much call for this function (pun intended) but I try to keep it updated because it is called by some of the scripts I've published.

v2.0
Warning: New parameter. Code written for the previous version (v0.4) will probably need a minor change to accommodate for the new parameter.

What's new: Added p_Position parameter to allow the developer to specify the position where the child (popup) window will be located. See the documentation in the first post for more information.

And no, there was never a version 1.0 although v0.4 was effectively the v1.0 release.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Ragnar and 28 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group