Advertisement
ASP_Volume3 Games #44845

A Way to Change The Resolution

This is ideal for a game. Many games simply look better or work better in a different resolution. Mostly the look is because whatever resolution you were using on your computer at the time is what the graphics in the game will look best as. This code will simply enable you to set their computer resolution to whatever you want.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
'Changes the resolution to 640x480 with the current colordepth.
Dim DevM As DEVMODE
'Get the info into DevM
erg& = EnumDisplaySettings(0&, 0&, DevM)
'We don't change the colordepth, because a
'rebot will be necessary
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT 'Or DM_BITSPERPEL
DevM.dmPelsWidth = 640 'ScreenWidth
DevM.dmPelsHeight = 480 'ScreenHeight
'DevM.dmBitsPerPel = 32 (could be 8, 16, 32 or even 4)
'Now change the display and check if possibleerg& = ChangeDisplaySettings(DevM, CDS_TEST)
'Check if succesfullSelect Case erg&
Case DISP_CHANGE_RESTART
  an = MsgBox("You've to reboot", vbYesNo + vbSystemModal, "Info")
  If an = vbYes Then
    erg& = ExitWindowsEx(EWX_REBOOT, 0&)
  End If
Case DISP_CHANGE_SUCCESSFUL
  erg& = ChangeDisplaySettings(DevM, CDS_UPDATEREGISTRY)
  MsgBox "Everything's ok", vbOKOnly + vbSystemModal, "It worked!"
Case Else
  MsgBox "Mode not supported", vbOKOnly + vbSystemModal, "Error"
End SelectEnd Sub

Upload
Original Comments (3)
Recovered from Wayback Machine