|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Ocultando barra de tarefas
|
|
|
|
Postada em 4/5/2006 por Geronimo
O código abaixo tem vantagem de funcionar mesmo que a barra esteja no topo da tela ou em um dos lados.
Para testar basta desenhar um commandbutton e colar o seguinte código:
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Const SPI_GETWORKAREA = 48
Sub TelaToda(frm As Form)
Dim lNewTop As Long, lNewLeft As Long Dim WA As RECT, lReturn As Long ' Busca as coordenadas da tela excluindo a barra de tarefas lReturn = SystemParametersInfo(SPI_GETWORKAREA, 0&, WA, 0&)
' Converte de pixels para twips WA.Left = WA.Left * Screen.TwipsPerPixelX WA.Right = WA.Right * Screen.TwipsPerPixelX WA.Top = WA.Top * Screen.TwipsPerPixelY WA.Bottom = WA.Bottom * Screen.TwipsPerPixelY
Me.Move 0, 0, WA.Right - WA.Left, WA.Bottom - WA.Top End Sub
Private Sub Command1_Click()
TelaToda Me End Sub
Private Sub Form_Load()
Command1.Caption = "Clique Para Maximizar" End Sub
|
|
|
|
|