Window Size

Window Size

Anonymous
Not applicable
349 Views
3 Replies
Message 1 of 4

Window Size

Anonymous
Not applicable
Hello,

 

Is it possible to
obtain the size of the AutoCAD window?  I did not see this in the object
model.  I would like this information to properly resize my forms at load
time.

 

Mark
0 Likes
350 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Use the GetWindowRect Win32 API function.

--
http://www.acadx.com


"Mark Palacios" wrote in message
news:B0152EE26E094026BA2AD32C8983110A@in.WebX.maYIadrTaRb...
> Hello,
>
> Is it possible to obtain the size of the AutoCAD window? I did not
see this in the object model. I would like this information to
properly resize my forms at load time.
>
> Mark
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Keep in mind that the drawing editor window has a different hWnd. But then
again, all child windows have a different hWnd. The only difference is that
if you have forms or toolbars docked in the window the returned X,Y height
and width may not include the docked windows.

Hope this helps.


"Mark Palacios" wrote in message
news:B0152EE26E094026BA2AD32C8983110A@in.WebX.maYIadrTaRb...
Hello,

Is it possible to obtain the size of the AutoCAD window? I did not see this
in the object model. I would like this information to properly resize my
forms at load time.

Mark
0 Likes
Message 4 of 4

Anonymous
Not applicable
Mark,

 

Here is how this is done.

 

Private Sub UserForm_Click()
  With
ThisDrawing.Application
    MsgBox "Height = " & .Height
& " Width = " & .Width
    'cannot reset size if
window is maximized
    .WindowState =
acNorm
    .Height = 500: .Width = 500
   
MsgBox "Height = " & .Height & " Width = " & .Width
  End
With
End Sub

--
Get on the emailing list for
notification of the NEW "AutoCAD Visual Basic Programmers Reference" - the
ultimate guide to Visual Basic programming for R14/2000/2000i and 2002 by
clicking on the link below

href="mailto:omnisource@worldnet.att.net?subject=NewVBTitle">mailto:omnisource@worldnet.att.net?sub...

 

Joe Sutphin
Author of "AutoCAD 2000 VBA Programmers
Reference"
ISBN #1861002564


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hello,

 

Is it possible to
obtain the size of the AutoCAD window?  I did not see this in the object
model.  I would like this information to properly resize my forms at load
time.

 

Mark
0 Likes