none
Ocultar a Barra de tarefas RRS feed

  • Pergunta

  • Boa tarde, novamente

    Estou encontrando uma dificuldade para fazer outra tarefa aparentemente simples, gostaria de ocultar a barra de tarefas do windows, pois não estou conseguindo encontrar e nem endenter como isto se procede, se laguém tiver algum material para VB 2005.

    Att.

    Leandro Matos
    quinta-feira, 25 de outubro de 2007 14:59

Respostas

  • Leandro:

     

    É relamente simples.

     

    Crie um projeto novo com um form, adicione o código e teste.

     

    Public Class Form1

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal ByVallpClassName As String, ByVal lpWindowName As String) As Integer

    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal ByValhWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

     

    Public Const SWP_HIDEWINDOW = &H80

    Public Const SWP_SHOWWINDOW = &H40

     

    Private Sub cmdHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdhide.Click

    Dim intReturn As Integer = FindWindow("Shell_traywnd", "")

    SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

    End Sub

     

    Private Sub cmdUnhide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdunhide.Click

    Dim intReturn As Integer = FindWindow("Shell_traywnd", "")

    SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

    End Sub

     

    End Class

     

    Abs,

    quinta-feira, 25 de outubro de 2007 22:16

Todas as Respostas

  • Leandro:

     

    É relamente simples.

     

    Crie um projeto novo com um form, adicione o código e teste.

     

    Public Class Form1

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal ByVallpClassName As String, ByVal lpWindowName As String) As Integer

    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal ByValhWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer

     

    Public Const SWP_HIDEWINDOW = &H80

    Public Const SWP_SHOWWINDOW = &H40

     

    Private Sub cmdHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdhide.Click

    Dim intReturn As Integer = FindWindow("Shell_traywnd", "")

    SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)

    End Sub

     

    Private Sub cmdUnhide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdunhide.Click

    Dim intReturn As Integer = FindWindow("Shell_traywnd", "")

    SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)

    End Sub

     

    End Class

     

    Abs,

    quinta-feira, 25 de outubro de 2007 22:16
  • Cara pela primeira vez algo que funcione. Grato pela sua atenção e até a próxima.

    Att.

    Leandro Matos.
    sexta-feira, 26 de outubro de 2007 01:14