Dicas Excel Macros VBA


Retirar a barra de tarefa do Windows

Pergunta 53:
É possível retirar a barra de tarefa do Windows através de macros vba?

Resposta 53:
Sim é possível

'
Oculta, esconde a barra de tarefas do Windows, ferramenta tarefa
'Módulo 1

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

'modo private do CommandButton1
Option Explicit
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40

Sub Esconder_I()
http://www.saberexcelcom
e-mail: vba@saberexcel.com
SetWindowPos FindWindow("Shell_traywnd", ""), 0, 0, 0, 0, 0, SWP_HIDEWINDOW
End Sub

Sub Esconder_II()
http://www.saberexcelcom
e-mail: vba@saberexcel.com
SetWindowPos FindWindow("Shell_traywnd", ""), 0, 0, 0, 0, 0, SWP_SHOWWINDOW
End Sub

 

[ Fechar Janela ]