|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
| View Poll Results: Where did you use this program for testing? | |||
| at Work | | 1 | 100.00% |
| at College assignment | | 0 | 0% |
| Utility development | | 0 | 0% |
| others | | 0 | 0% |
| Voters: 1. You may not vote on this poll | |||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
'This is the small program to identify the screen resolution
'if resolution is less then 800x600 ~~~~~~~~~~~~~~~~~ Private function IsValidScreenResolution as boolean dim intWidth, intHeight as Integer intWidth = GetSystemMetrics(SM_CXSCREEN) intHeight = GetSystemMetrics(SM_CYSCREEN) If (intWidth < 800) Or (intHeight < 600) Then msgbox "Screen resolution is less then 800x600" else IsValidScreenResolution=true End If End Function ~~~~~~~~~~~~~~~~~ PS: D nt forget include "GetSystemMetrics" system function (un user32.dll)...if any other issues or problems, pls feel to contact me @binoy_rb@h tmail.comthanks Binoy |
|
#2
|
|||
|
|||
Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long |
|
#3
|
|||
|
|||
|
Quote:
hi binoyraj, i am puuting your code as: '============= 'Including system library file Public Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long 'This is the small program to identify the screen resolution 'if resolution is less then 800x600 '~~~~~~~~~~~~~~~~~ Private Function IsValidScreenResolution() As Boolean Dim intWidth, intHeight As Integer intWidth = GetSystemMetrics(SM_CXSCREEN) intHeight = GetSystemMetrics(SM_CYSCREEN) If (intWidth < 800) Or (intHeight < 600) Then MsgBox "Screen resolution is less then 800 x 600" Else IsValidScreenResolution = True End If End Function '''~~~~~~~~~~~~~~~~~ Private Sub Form_Load() Call IsValidScreenResolution End Sub '============= But, when i Run the program, it is giving me Compile Error saying: Constants, fixed-length strings, arrays, user-defined types and declare statements not allow as Public members of object modules. Then i removed the 'Public' from the declaring statement. Still, its not working. ![]() Also, i want to change the machine's resolution to 1280 x 1024, irrespective of the current machine's resolution. can u help me to do this ? ![]() thanx in adv. -@shik143. |
|
#4
|
|||
|
|||
|
hey,
is there no one 2 solve this query ? |
|
#5
|
|||
|
|||
|
Quote:
No api needed Code:
Function IsValidScreenResolution(ByVal X_Max As Integer, ByVal Y_max As Integer) As Boolean IsValidScreenResolution = (Screen.Height / Screen.TwipsPerPixelY >= Y_max) And (Screen.Width / Screen.TwipsPerPixelX >= X_Max) End Function |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Screen Resolution in VB 6.0 (600X800) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|