新建From1(窗体),新建Command1-2(按钮CommandButton),代码:
Private Sub Command1_Click()
Call HideTaskBar
End Sub
Private Sub Command2_Click()
Call ShowTaskBar
End Sub
Private Sub HideTaskBar()
TaskBarhWnd = FindWindow("Shell_traywnd", "")
If TaskBarhWnd <> 0 Then
Call SetWindowPos(TaskBarhWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End If
End Sub
Private Sub ShowTaskBar()
If TaskBarhWnd <> 0 Then
Call SetWindowPos(TaskBarhWnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End If
End Sub
可以得到当前窗口的标题。