VB实现桌面隐藏如何恢复
麻烦版主或高手指点指点Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
'定义窗口以及子窗口的类名
Private Const sTrayWindow = "Shell_TrayWnd"
Private Const sDesktopIcon = "ShellDll_DefView"
Private Const sProgman = "Progman"
Private Const SW_SHOW = 5
Private Const SW_HIDE = 0
Dim wnd As Long, wnd1 As Long
Dim lbHide As Boolean
Private Sub Command1_Click()
Dim i As Integer
wnd1 = FindWindow(sTrayWindow, vbNullString)
wnd = FindWindow(sProgman, vbNullString)
wnd = FindWindowEx(wnd, 0, sDesktopIcon, vbNullString)
If lbHide = False Then
ShowWindow wnd, SW_HIDE
ShowWindow wnd1, SW_HIDE
lbHide = True
Else
ShowWindow wnd, SW_SHOW
ShowWindow wnd1, SW_SHOW
lbHide = False
End If
End Sub
[[italic] 本帖最后由 ytsm0526 于 2007-12-22 10:18 编辑 [/italic]]