Dear Team.
My Program will work Effectively in 1024*768.Now I want to check wheather the this computer supports this screen resolution and supports 32 bit also.How can I ?
Printable View
Dear Team.
My Program will work Effectively in 1024*768.Now I want to check wheather the this computer supports this screen resolution and supports 32 bit also.How can I ?
is your program a game?
if not then make sure your app supports their resolution - not the other way round...
MY Program is not a game.I want to check the resollution .If the machine doesn't support the 1024*768, i have to end the program.How can I check the screen resolution.
there are several ways - here's just one:VB Code:
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Sub Command1_Click() Debug.Print GetSystemMetrics(SM_CXSCREEN) & " x " & GetSystemMetrics(SM_CYSCREEN) End Sub
Dear Bushmobile.
Thanks for the post.Will is return only 1024*768 or some other.
it returns the screen width & height in Pixels
Will it return only 1024 * 768 or some other display modes? or 800*600 also.
if the screen's width is 800 and it's height in 600 then it will return 800 x 600.
resolution is just the number of pixels that are on the screen
Please explain how to loop through the Resolution schme and check for the 1024*768 mode.Thanks in advance.
based on the example at AllAPI.netVB Code:
Option Explicit Const ENUM_CURRENT_SETTINGS As Long = -1& Const CCDEVICENAME = 32 Const CCFORMNAME = 32 Private Type DEVMODE dmDeviceName As String * CCDEVICENAME dmSpecVersion As Integer dmDriverVersion As Integer dmSize As Integer dmDriverExtra As Integer dmFields As Long dmOrientation As Integer dmPaperSize As Integer dmPaperLength As Integer dmPaperWidth As Integer dmScale As Integer dmCopies As Integer dmDefaultSource As Integer dmPrintQuality As Integer dmColor As Integer dmDuplex As Integer dmYResolution As Integer dmTTOption As Integer dmCollate As Integer dmFormName As String * CCFORMNAME dmUnusedPadding As Integer dmBitsPerPel As Integer dmPelsWidth As Long dmPelsHeight As Long dmDisplayFlags As Long dmDisplayFrequency As Long End Type Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" ( _ ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean Private Sub Command1_Click() Dim DevM As DEVMODE, lEnum As Long EnumDisplaySettings 0&, ENUM_CURRENT_SETTINGS, DevM Debug.Print "Currently: " & DevM.dmPelsWidth; " x " & DevM.dmPelsHeight & " at " & DevM.dmBitsPerPel & " bits/pixel" Debug.Print vbCrLf & "Available:" Do While EnumDisplaySettings(0&, lEnum, DevM) Debug.Print DevM.dmPelsWidth & " x " & DevM.dmPelsHeight & " at " & DevM.dmBitsPerPel & " bits/pixel" lEnum = lEnum + 1 Loop End Sub
why do you need to bother tho - check if the resolution isn't the same as your ideal using the code in post #4 and then flash up a msgBox saying "best viewed in X by Y"
I am doing for Internet Explore viewing.I have to restrict to user to 1024*768.So only i need to end my application if the system doesn't support that resolution
Thanks Bushmobile,
Its working.Can you help me in getting the bit format of the system like 32 bit , 16 bit or 64 bit?
i dunno, i guess you'd have to work it out from the OS Version
That doen't give the bit size?
nope - it gives you OS version, from which you can derive the bit-version
i'm not sure if you can just get the bit-version - perhaps start a new thread (people will be more likely to look at it).
Are you sure you mean the bit-version of the system and not the screen bit depth?