Visual Basic - Ocultar el Escritorio

Life is soft - evento anual de software empresarial
 
Vista:

Ocultar el Escritorio

Publicado por Lucas M. Alonso Carli (2 intervenciones) el 08/10/2000 00:00:00
Hola atodos!
Mi nombre es Lucas tengo 14 años y programo en VB y nesecito ocultar el Escritorio hasta ahora lo oculto pero no lo puedo hacer aparecer.
Si alguien me puede facilitar esta informacion o algo por el estilo se lo agradeceria mucho, mi mail en "[email protected]" y el programa lo estoy haciendo sobre vb6.
aqu´i esta lo poco que logre:
Gracias!

En el módulo
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public Const WM_HIDE = &H2

Y en el Form

Dim winHwnd As Long
Dim RetVal As Long
winHwnd = FindWindow(vbNullString, "Program Manager")
Debug.Print winHwnd
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, WM_HIDE, 0&, 0&)
If RetVal = 0 Then
MsgBox "Error enviando mensaje."
End If
End If
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Ocultar el Escritorio

Publicado por tecniCam (220 intervenciones) el 09/10/2000 00:00:00
Eso no lo he intentado nunca. Mira a ver si te sirve esto:
´ Comandos ShowWindow()
Public Const SW_HIDE = 0
Public Const SW_SHOWNORMAL = 1
Public Const SW_NORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_RESTORE = 9
Public Const SW_SHOWDEFAULT = 10
Public Const SW_MAX = 10
´ Comandos Old ShowWindow()
Public Const HIDE_WINDOW = 0
Public Const SHOW_OPENWINDOW = 1
Public Const SHOW_ICONWINDOW = 2
Public Const SHOW_FULLSCREEN = 3
Public Const SHOW_OPENNOACTIVATE = 4
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ocultar el Escritorio

Publicado por DanAde (4 intervenciones) el 10/10/2000 00:00:00
Mas sencillo,Lucas:
una vez conseguido el handle al escritorio con FindWindow, solo necesitas esto:
ShowWindow handle_escr,SW_HIDE
y para que aparezca otra vez:
ShowWindow handle_escr,SW_SHOW

siendo en tu caso handle_escr=winHwnd y declarando con el visor de API la funcion ShowWindow y las constantes.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Ocultar el Escritorio

Publicado por Azazel (2 intervenciones) el 27/06/2001 22:22:16
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

despues utiliza estas funciones en tu formulario

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar