RESOLUCAO DE TELA
To com um problema aqui que tá me tirando o sono. A resolução de tela da aplicação no meu pc tá perfeita , mas ao instalar em outro computador com resolução diferente bagunça geral, é form fora do lugar, barra de progresso que não aparece.. uma beleza. só que não to conseguindo resolver isso, busquei no site uns exemplos mas não funcionam aqui. Preciso de uma santa alma que me ajude nisso. pago uma tubaina com sanduiche de mortadela.
COLOCA ESSE CODIGO NO SEU SISTEMA é SO ALTERA A RESOLUÇÃO DE ACORDO COM O SEU SISTEMA
QUANDO SAIR DO SISTEMA PEDE PARA ELE RETORNAR A RESOLUÇÃO ANTERIOR.
[ô]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
QUANDO SAIR DO SISTEMA PEDE PARA ELE RETORNAR A RESOLUÇÃO ANTERIOR.
[ô]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
Faça seu login para responder