PBOBLEMAS COM RESOLUCOES DE VIDEO
Amigos,
Fiz um programa no modo de resolução 1024 x 760, onde ultilizo um menu de tela cheia.
Bem, rodei o programa no modo de resolução 800 x 600, só que o menu não apareceu completamente como no modo anterior.
Não sei se tem como fazer algum esquema que faça o programa se adaptar a resoluções do windows?
Ou é assim mesmo?
Fiz um programa no modo de resolução 1024 x 760, onde ultilizo um menu de tela cheia.
Bem, rodei o programa no modo de resolução 800 x 600, só que o menu não apareceu completamente como no modo anterior.
Não sei se tem como fazer algum esquema que faça o programa se adaptar a resoluções do windows?
Ou é assim mesmo?
tente fazer no load do form principal um programa para mudar a resolução, e quando o usuário sair, volta a resolução padrão!
Se quiser o Código, posso lhe arrumar...
Se quiser o Código, posso lhe arrumar...
ficaria grato amigo
[txt-size=3]' Código em um módulo .bas[/txt-size]
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Declare Function GetClipCursor Lib "user32.dll" (lprc As RECT) As Long
Public Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
Public 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
Const CCDEVICENAME = 32
Const CCFORMNAME = 32
Const DM_PELSWIDTH = &H80000
Const DM_PELSHEIGHT = &H100000
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
Dim DevM As DEVMODE
Public Sub ChangeRes(iWidth As Single, iHeight As Single)
Dim a As Boolean
Dim i As Long
Do
a = EnumDisplaySettings(0&, i, DevM)
i = i + 1
Loop Until (a = False)
Dim b As Long
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
DevM.dmPelsWidth = iWidth
DevM.dmPelsHeight = iHeight
b = ChangeDisplaySettings(DevM, 0)
End Sub
[txt-size=4]'agora este é o código do form[/txt-size]
Dim ResX As Single
Dim ResY As Single
Dim OldResX As Single
Dim OldResY As Single
Dim Resolucao As Boolean
'logo abaixo você chama o procedimento:
Call ChangeRes(640, 480)
'muda para a resolução 640x480, você escolhe qual resolução
'use o Load e Unload do form
Espero ter ajudado!
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Declare Function GetClipCursor Lib "user32.dll" (lprc As RECT) As Long
Public Declare Function GetSystemMetrics Lib "User" (ByVal nIndex As Integer) As Integer
Public 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
Const CCDEVICENAME = 32
Const CCFORMNAME = 32
Const DM_PELSWIDTH = &H80000
Const DM_PELSHEIGHT = &H100000
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
Dim DevM As DEVMODE
Public Sub ChangeRes(iWidth As Single, iHeight As Single)
Dim a As Boolean
Dim i As Long
Do
a = EnumDisplaySettings(0&, i, DevM)
i = i + 1
Loop Until (a = False)
Dim b As Long
DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
DevM.dmPelsWidth = iWidth
DevM.dmPelsHeight = iHeight
b = ChangeDisplaySettings(DevM, 0)
End Sub
[txt-size=4]'agora este é o código do form[/txt-size]
Dim ResX As Single
Dim ResY As Single
Dim OldResX As Single
Dim OldResY As Single
Dim Resolucao As Boolean
'logo abaixo você chama o procedimento:
Call ChangeRes(640, 480)
'muda para a resolução 640x480, você escolhe qual resolução
'use o Load e Unload do form
Espero ter ajudado!
muito obrigado amigo mario
Tópico encerrado , respostas não são mais permitidas