PC Review


Reply
Thread Tools Rate Thread

ActiveWindow.Width

 
 
=?Utf-8?B?TXJU?=
Guest
Posts: n/a
 
      25th Jun 2007
Hello,

I can't find the unit in which the ActiveWindow.Width is given.

If I maximize the window and get the mouse position, I get a
ActiveWindow.Width that is about 1.32 times less the screen size in pixles.
The ratio is about 1.1 if I minimize it.

Does anyone know what is the unit of the ActiveWindow.Width property?

Thanks in advance for your insight.
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      25th Jun 2007
Returns the width of a window in points (point: Unit of measure referring to
the height of a printed character. A point equals 1/72 of an inch, or
approximately 1/28 of a centimeter.).

--
Jim
"MrT" <(E-Mail Removed)> wrote in message
news:FFD41F6C-6A9A-47A6-8957-(E-Mail Removed)...
| Hello,
|
| I can't find the unit in which the ActiveWindow.Width is given.
|
| If I maximize the window and get the mouse position, I get a
| ActiveWindow.Width that is about 1.32 times less the screen size in
pixles.
| The ratio is about 1.1 if I minimize it.
|
| Does anyone know what is the unit of the ActiveWindow.Width property?
|
| Thanks in advance for your insight.


 
Reply With Quote
 
=?Utf-8?B?TXJU?=
Guest
Posts: n/a
 
      25th Jun 2007
Jim,

Thanks, but I can't understand why, when the windows is maximized, I get
1472 for ActiveWindow.PointsToScreenPixelsX(ActiveWindow.Width) when the
width of my screen is 1920 pixels (ActiveWindow.Width is 1444.5).

Regards,

MrT

"Jim Rech" wrote:

> Returns the width of a window in points (point: Unit of measure referring to
> the height of a printed character. A point equals 1/72 of an inch, or
> approximately 1/28 of a centimeter.).
>
> --
> Jim
> "MrT" <(E-Mail Removed)> wrote in message
> news:FFD41F6C-6A9A-47A6-8957-(E-Mail Removed)...
> | Hello,
> |
> | I can't find the unit in which the ActiveWindow.Width is given.
> |
> | If I maximize the window and get the mouse position, I get a
> | ActiveWindow.Width that is about 1.32 times less the screen size in
> pixles.
> | The ratio is about 1.1 if I minimize it.
> |
> | Does anyone know what is the unit of the ActiveWindow.Width property?
> |
> | Thanks in advance for your insight.
>
>
>

 
Reply With Quote
 
Jim Rech
Guest
Posts: n/a
 
      25th Jun 2007
I cannot vouch for the PointToScreenPixelsX method. When I was doing
'screen work' (quite awhile ago) I used this method to figure out where I
was on the screen in pixels:

Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex
As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As
Long) As Long
Const LOGPIXELSX = 88 ''Index into GetDeviceCaps array for number of pixels
per logical inch along the screen width
Const POINTS_PER_INCH As Long = 72

Function PointsPerPixel() As Double
Dim hDC As Long
Dim lDotsPerInch As Long
hDC = GetDC(0)
lDotsPerInch = GetDeviceCaps(hDC, LOGPIXELSX) ''Get the user's DPI
setting
PointsPerPixel = POINTS_PER_INCH / lDotsPerInch
ReleaseDC 0, hDC
End Function

Sub Test()
MsgBox ActiveWindow.Width / PointsPerPixel ''Screen width in pixels
End Sub


--
Jim
"MrT" <(E-Mail Removed)> wrote in message
news:885ED21B-4933-49CF-89C9-(E-Mail Removed)...
| Jim,
|
| Thanks, but I can't understand why, when the windows is maximized, I get
| 1472 for ActiveWindow.PointsToScreenPixelsX(ActiveWindow.Width) when the
| width of my screen is 1920 pixels (ActiveWindow.Width is 1444.5).
|
| Regards,
|
| MrT
|
| "Jim Rech" wrote:
|
| > Returns the width of a window in points (point: Unit of measure
referring to
| > the height of a printed character. A point equals 1/72 of an inch, or
| > approximately 1/28 of a centimeter.).
| >
| > --
| > Jim
| > "MrT" <(E-Mail Removed)> wrote in message
| > news:FFD41F6C-6A9A-47A6-8957-(E-Mail Removed)...
| > | Hello,
| > |
| > | I can't find the unit in which the ActiveWindow.Width is given.
| > |
| > | If I maximize the window and get the mouse position, I get a
| > | ActiveWindow.Width that is about 1.32 times less the screen size in
| > pixles.
| > | The ratio is about 1.1 if I minimize it.
| > |
| > | Does anyone know what is the unit of the ActiveWindow.Width property?
| > |
| > | Thanks in advance for your insight.
| >
| >
| >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel.ActiveWindow Is Excel.ActiveWindow Returns False Neal Andrews Microsoft Excel Programming 1 26th Oct 2006 11:10 AM
ActiveWindow.VisibleRange.Width - Is this the correct code =?Utf-8?B?U3RldmVuUw==?= Microsoft Excel Programming 1 15th Oct 2005 06:34 AM
Textbox width scaling to width of data not width of page? AndrewF Microsoft ASP .NET 1 10th Oct 2005 05:38 PM
ActiveWindow.Width no longer works for me! rickety Microsoft Excel Programming 2 1st Sep 2004 01:29 AM
Re: ActiveWindow.Width no longer works for me! rickety Microsoft Excel Programming 0 1st Sep 2004 01:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 PM.