利用API函数实现隐藏和显示桌面图标

2008-02-23 06:59:57来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_RESTORE = 9

'隐藏桌面图标
Private Sub Command1_Click()
Dim Hwd As Long
Dim rtn As Long
Hwd = FindWindow("Progman", VBNullString)
rtn = ShowWindow(Hwd, SW_HIDE)
End Sub

'显示桌面图标
Private Sub Command2_Click()
Dim Hwd As Long
Dim rtn As Long
Hwd = FindWindow("Progman", vbNullString)
rtn = ShowWindow(Hwd, SW_RESTORE)
End Sub

上一篇: 用API函数遍历指定驱动器、目录的文件
下一篇: 谈谈Windows API 在VB 中的应用

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:怎样存取注册表信息

下一篇:用VB实现聊天讨论室和点对点会话