screen-resolution

  • Thread starter Thread starter Jan Hx.
  • Start date Start date
J

Jan Hx.

Hi,

I want to use the Form_Load-procedure to do some 'controls-rearanging'
depending on the screenresolution.
How do I find out wich resolution is being used?

Thanx!
Jan Hx.
 
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Declare Function apiGetSys Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long


Public Function ScreenWidth() As Long
ScreenWidth = apiGetSys(SM_CXSCREEN)
End Function

Public Function ScreenHeight() As Long
ScreenHeight = apiGetSys(SM_CYSCREEN)
End Function
 
Tnx Tim! It works just fine!

Tim said:
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Declare Function apiGetSys Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long


Public Function ScreenWidth() As Long
ScreenWidth = apiGetSys(SM_CXSCREEN)
End Function

Public Function ScreenHeight() As Long
ScreenHeight = apiGetSys(SM_CYSCREEN)
End Function
 
Back
Top