RE: Ocultar el escritorio
Publicado por Azazel (2 intervenciones) el 27/06/2001 22:15:57
Attribute VB_Name = "Module1"
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
As String) As Long
Private 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
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
'para ocultar la barra de tareas y el escritorio
Public Function HideTaskBar() As Boolean
Dim lRet As Long
Dim winHwnd As Long
lRet = FindWindow("Shell_traywnd", "")
winHwnd = FindWindow(vbNullString, "Program Manager")
If lRet > 0 Then
lRet = SetWindowPos(lRet, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
winHwnd = SetWindowPos(winHwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
HideTaskBar = lRet > 0
End If
End Function
'para mostrar de nuevo la barra de tareas y el escritorio
Public Function ShowTaskBar() As Boolean
Dim lRet As Long
Dim winHwnd As Long
lRet = FindWindow("Shell_traywnd", "")
If lRet > 0 Then
winHwnd = FindWindow(vbNullString, "Program Manager")
lRet = SetWindowPos(lRet, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
winHwnd = SetWindowPos(winHwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
ShowTaskBar = lRet > 0
End If
End Function
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
As String) As Long
Private 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
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
'para ocultar la barra de tareas y el escritorio
Public Function HideTaskBar() As Boolean
Dim lRet As Long
Dim winHwnd As Long
lRet = FindWindow("Shell_traywnd", "")
winHwnd = FindWindow(vbNullString, "Program Manager")
If lRet > 0 Then
lRet = SetWindowPos(lRet, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
winHwnd = SetWindowPos(winHwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
HideTaskBar = lRet > 0
End If
End Function
'para mostrar de nuevo la barra de tareas y el escritorio
Public Function ShowTaskBar() As Boolean
Dim lRet As Long
Dim winHwnd As Long
lRet = FindWindow("Shell_traywnd", "")
If lRet > 0 Then
winHwnd = FindWindow(vbNullString, "Program Manager")
lRet = SetWindowPos(lRet, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
winHwnd = SetWindowPos(winHwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
ShowTaskBar = lRet > 0
End If
End Function
Valora esta pregunta
0