Hey Guys,
I got some code from this forum to resize the screen to a specific size that i specify. I have attached the .bas file for your perusal. My problem is that i need the code to resize the screen to 1024x768 if the current size is smaller. The program is supposed to either resize the screen or abort execution if it cannot. This is the code i use to do it
VB Code:
Public Sub ResizeScreenTo1024()
Dim r As Integer
'try to set the screen res here
'get the screen resolution and color depth
originalResolution = GetScreenResolution()
originalDepth = GetAvailableColours()
xOriginalWidth = GetCurrentXSetting
yOriginalWidth = GetCurrentYSetting
'try to change the resolution to 1024 x 768 with 32,24,16,8,4 until success
If (xOriginalWidth < 1024) And (yOriginalWidth < 768) Then
Call ChangeScreenSettings(1024, 768, 32)
If changeSuccessful = False Then
'32 failed, try 24
Call ChangeScreenSettings(1024, 768, 24)
If changeSuccessful = False Then
'24 failed, try 16
Call ChangeScreenSettings(1024, 768, 16)
If changeSuccessful = False Then
'16 failed, try 8
Call ChangeScreenSettings(1024, 768, 8)
If changeSuccessful = False Then
'8 failed, try 4
Call ChangeScreenSettings(1024, 768, 4)
If changeSuccessful = False Then
r = MsgBox("Your computer cannot operate this software.", vbCritical, "VideoVision 1.0")
End If
End If
End If
End If
End If
End If
End Sub
Now what actually happens is that on some computers the screen doesn't actually change size, but the program begins execution, when it should abort. Also on some computers, the screen sometimes resizes and sometimes doesn't. Is it possible that this code is the cause of this? Or is it more likely to be an individual computer issue? If so, is there some more dynamic code to resize the screen of these computers?
Hoping someone can help,
Regards
We don't know what's wrong. . . So the best bet might be to remove something surgically.