Results 1 to 3 of 3

Thread: screen resolution

  1. #1

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444
    Can I query the system to find out what the current display is set to?
    I have a form that I want to appear on the right side of the screen X distance from the right and Y distance down from the top.
    This is somewhat dependant on the resolution of the monitor.
    this is basically a little help form that is always on top. I want it on the right so the user can go through the menus step by step with the help instructions.
    This company has a range of resolutions from 1024X768 to mine which is 1600X1200
    any ideas.
    I am so skeptical, I can hardly believe it!
    PS I am not a 'hyperactive member' I am a cool, calm, and collected member

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Try this:
    Code:
    dim ScreenWidth as integer
    dim ScreenHeigth as integer
    
    screenwidth=screen.width/screen.twipsperpixelx
    screenheight=screen.heigth/screen.twipsperpixely

  3. #3

    Thread Starter
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444
    I am trying the following
    VB Code:
    1. Private Declare Function GetDesktopWindow Lib "user32" () As Long
    2. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    3. Private Type RECT
    4.         Left As Long
    5.         Top As Long
    6.         Right As Long
    7.         Bottom As Long
    8. End Type
    9.  
    10. Private Sub Form_Load()
    11. Dim desktop As Long
    12. Dim MyRect As RECT
    13. Dim h As Long
    14. desktop = GetDesktopWindow()
    15. h = GetWindowRect(desktop, MyRect)
    16. SetWindowPos Me.hwnd, HWND_TOPMOST, (MyRect.Right - 900), (MyRect.Bottom - 600), 500, 500, 0 'API to keep the AutoCAD manual on top
    myrect.right is the resolution in width
    myrect.bottom is the resolution in height
    I have not finished yet but this seems to be working.
    cross my fingers
    This snipit does not have the declare for the setwindowpos api
    I am so skeptical, I can hardly believe it!
    PS I am not a 'hyperactive member' I am a cool, calm, and collected member

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width