Indigo Rose Software
  #1  
Old 09-27-2002
Support Support is offline
Super Moderator
 
Join Date: Jan 2000
Location: Indigo Rose Corporation
Posts: 204
HOWTO: Get the Position and Size of a Window

HOWTO: Get the Position and Size of a Window

HOWTO: Get the Position and Size of a Window

Document ID: IR04007
The information in this article applies to:
  • AutoPlay Media Studio 4.0

SUMMARY

This article describes how to determine the position and size of a window using AutoPlay Media Studio 4.0.

DISCUSSION

AutoPlay Media Studio has a built-in action that can be used to move and resize a window called Window.Move. However, it does not have actions that can be used to determine the screen co-ordinates of a window. This information could be useful if you want to use Window.Move to move a window, but want to be able to restore it to its original size or position later. Another use of such functionality would be that you could store your AutoPlay application's coordinates in the Registry when the application closes and then read them in and restore the size and position when the application starts again.

To address this lack of functionality, Indigo Rose has produced a DLL called IRGetWindowPos.dll that allows you to access this functionality from AutoPlay Media Studio. IRGetWindowPos.dll exposes four functions:

long GetTop(HWND hWnd)
long GetLeft(HWND hWnd)
long GetHeight(HWND hWnd)
long GetWidth(HWND hWnd)

These four functions allow you to get the left (x), top (y), height and width of the window for which a handle is passed in. To use these functions on your AutoPlay application window, pass in %MenuHWnd% as the hWnd argument. Otherwise you can use the Window category of actions to find other windows (and their handles) that are displayed on the system.

IRGetWindowPos.dll and a sample project that uses it can be downloaded from Indigo Rose. Click here to download GetWindowPos.zip. The sample project shows how to get the window size and position on demand as well as how to make a window maintain its size and position between sessions.

MORE INFORMATION

For more information, please read the following topics in the AutoPlay Media Stuio 4.0 help file:

  • Command Reference | Actions | File | Call DLL Function
  • Command Reference | Actions | Window | Move

KEYWORDS: window position, Window.Move, IRGetWindowPos.dll


Last reviewed: October 3, 2002
Copyright © 2002 Indigo Rose Corporation. All rights reserved.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 11:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software