|
-
Aug 16th, 2000, 03:52 PM
#1
Thread Starter
Hyperactive Member
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 
-
Aug 16th, 2000, 03:56 PM
#2
Fanatic Member
Try this:
Code:
dim ScreenWidth as integer
dim ScreenHeigth as integer
screenwidth=screen.width/screen.twipsperpixelx
screenheight=screen.heigth/screen.twipsperpixely
-
Aug 16th, 2000, 04:49 PM
#3
Thread Starter
Hyperactive Member
I am trying the following
VB Code:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim desktop As Long
Dim MyRect As RECT
Dim h As Long
desktop = GetDesktopWindow()
h = GetWindowRect(desktop, MyRect)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|