?
Solved

Video risolution

Posted on 2004-04-28
6
Medium Priority
?
244 Views
Last Modified: 2011-09-20
Hi,
Is it possible from within VisualBasic (particulary from VBApplication in Access) to change the screen-resolution?
Example: from 800x600 to 1024x768  and viceversa?
Thanks in advance.
0
Comment
Question by:Alexius71
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 10944335
0
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 10944355
to be exact this should have been the link:
http://www.mentalis.org/apilist/ChangeDisplaySettings.shtml
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10949660
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10949685
Thats a ***** rated ActiveX control developed by me that can also be found here: http://www.topshareware.com/Display-Mode-Manager-download-11495.htm

~ Ranjeet Rain
0
 

Expert Comment

by:IAmAnExpert
ID: 10957152
Hi,

Paste the code below into a Form, Class or Module and use the defined sub ChangeRes to change the resolution.

*
Option Explicit

Private Const CCDEVICENAME = 32
Private Const CCFORMNAME = 32
Private Const DM_PELSWIDTH = &H80000
Private Const DM_PELSHEIGHT = &H100000

Private Declare Function EnumDisplaySettings Lib "user32" _
    Alias "EnumDisplaySettingsA" _
    (ByVal lpszDeviceName As Long, _
    ByVal iModeNum As Long, _
    lpDevMode As Any) As Boolean
   
Private Declare Function ChangeDisplaySettings Lib "user32" _
    Alias "ChangeDisplaySettingsA" _
    (lpDevMode As Any, _
    ByVal dwflags As Long) As Long

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 Sub ChangeRes(iWidth As Single, iHeight As Single)
    Dim blnWorked As Boolean
    Dim i As Long
    Dim DevM As DEVMODE
   
    i = 0
   
    Do
        blnWorked = EnumDisplaySettings(0&, i, DevM)
        i = i + 1
    Loop Until (blnWorked = False)
       
    With DevM
        .dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
        .dmPelsWidth = iWidth
        .dmPelsHeight = iHeight
    End With
   
    Call ChangeDisplaySettings(DevM, 0)
End Sub
*
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 375 total points
ID: 10963932
IAmAnExpert,

your code will fail in case the attempted resolution is not supported. My ActiveX control includes error testing. It allows you to test whther a video mode is even supported or not. It even includes control over horizontal scan rate of video.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question