Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default ActiveWindow.Width

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default ActiveWindow.Width

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" wrote in message
...
| 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
mrt mrt is offline
external usenet poster
 
Posts: 70
Default ActiveWindow.Width

Jim,

Thanks, but I can't understand why, when the windows is maximized, I get
1472 for ActiveWindow.PointsToScreenPixelsX(ActiveWindow.Wi dth) 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" wrote in message
...
| 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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default ActiveWindow.Width

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" wrote in message
...
| Jim,
|
| Thanks, but I can't understand why, when the windows is maximized, I get
| 1472 for ActiveWindow.PointsToScreenPixelsX(ActiveWindow.Wi dth) 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" wrote in message
| ...
| | 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get ActiveWindow [email protected][_2_] Excel Programming 5 January 26th 07 04:09 AM
Excel.ActiveWindow Is Excel.ActiveWindow Returns False Neal Andrews Excel Programming 1 October 26th 06 11:10 AM
ActiveWindow.VisibleRange.Width - Is this the correct code StevenS Excel Programming 1 October 15th 05 06:34 AM
ActiveWindow.Width no longer works for me! rickety Excel Programming 2 September 1st 04 01:29 AM
ActiveWindow.Width no longer works for me! rickety[_2_] Excel Programming 0 September 1st 04 01:25 AM


All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"