RESOLUCAO
Boa tarde pessoal, olha alguém teria uma rotina para resolução de tela. é o seguinte gostaria de quando abrir meu sistema ficasse a resolução padrão que foi criado o programa, e quando fechar o sistema voltasse para a resolução normal do computador.
Desde já agradeço.
nero ÑÂúðчðть ñõÑÂÿûðтýþ
NO MODULO
Public ResX As Single
Public ResY As Single
Public OldX As Single
Public OldY As Single
Public resolucao As Boolean
[ô]muda data e sÃmbolo de R$
Public Const LOCALE_SSHORTDATE = &H1F
Public Const LOCALE_SCURRENCY = 20
Public Declare Function GetSystemDefaultLCID Lib [Ô]kernel32[Ô] () As Long
Public Declare Function SetLocaleInfo Lib [Ô]kernel32[Ô] Alias [Ô]SetLocaleInfoA[Ô] (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean
[ô]Public Declare Function GetClipCursor Lib [Ô]user32.dll[Ô] (lprc As RECT) As Long[ô]
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
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
NO FORM
X = Screen.Width \ Screen.TwipsPerPixelX
Y = Screen.Height \ Screen.TwipsPerPixelY
If X <> 1024 Or X <> 1360 And Y <> 768 Then
TimerBarra.Enabled = False
If (MsgBox([Ô]A Resolução do seu computador não é compatÃvel com a resolução do sistema[Ô] & vbCrLf & _
[Ô]Deseja alterar para uma resolução 1024 X 768 ?[Ô], vbQuestion + vbYesNo, [Ô]ATENÇÃO[Ô])) = vbYes Then
Call ChangeRes(1024, 768)
END IF
Public ResX As Single
Public ResY As Single
Public OldX As Single
Public OldY As Single
Public resolucao As Boolean
[ô]muda data e sÃmbolo de R$
Public Const LOCALE_SSHORTDATE = &H1F
Public Const LOCALE_SCURRENCY = 20
Public Declare Function GetSystemDefaultLCID Lib [Ô]kernel32[Ô] () As Long
Public Declare Function SetLocaleInfo Lib [Ô]kernel32[Ô] Alias [Ô]SetLocaleInfoA[Ô] (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean
[ô]Public Declare Function GetClipCursor Lib [Ô]user32.dll[Ô] (lprc As RECT) As Long[ô]
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
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
NO FORM
X = Screen.Width \ Screen.TwipsPerPixelX
Y = Screen.Height \ Screen.TwipsPerPixelY
If X <> 1024 Or X <> 1360 And Y <> 768 Then
TimerBarra.Enabled = False
If (MsgBox([Ô]A Resolução do seu computador não é compatÃvel com a resolução do sistema[Ô] & vbCrLf & _
[Ô]Deseja alterar para uma resolução 1024 X 768 ?[Ô], vbQuestion + vbYesNo, [Ô]ATENÇÃO[Ô])) = vbYes Then
Call ChangeRes(1024, 768)
END IF
Citação::
Boa tarde pessoal, olha alguém teria uma rotina para resolução de tela. é o seguinte gostaria de quando abrir meu sistema ficasse a resolução padrão que foi criado o programa, e quando fechar o sistema voltasse para a resolução normal do computador.
Mas isso vai afetar todos os outros programas que o usuário utiliza, não é?
Se voce quer isso para ajustar o controle do forms ao tamanho dele, da uma olhada nisto:
http://www.vbmania.com.br/pages/index.php?varModulo=Forum&varMethod=abrir&varID=348468&varWorld=
http://www.vbmania.com.br/pages/index.php?varModulo=Forum&varMethod=abrir&varID=348468&varWorld=
Tópico encerrado, já que foram postadas soluções que aparentemente resolvem o problema, além do colega JPAULO101 que não lembrou de voltar ao site para encerrá-lo.
Tópico encerrado , respostas não são mais permitidas