VB怎么实现隐藏桌面图标?

来源:百度知道 编辑:UC知道 时间:2024/06/14 00:08:37
我建了一个COMMNAD1,我想别人一按我的COMMMAD1他的桌面的任何图标都消失隐藏了。这怎么实现啊?
恩,另外,我建了一个VB,是不用按钮的。代码是这样:
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 Form_Load()
Dim Hwd As Long
Dim rtn As Long
Hwd = FindWindow("Progman", vbNullString)
rtn = ShowWindow(Hwd, SW_HIDE)

End Sub

工程名为111.exe

我想别人一打开我的111.exe就把111.exe增加到他的启动那里.他一开机就隐藏桌面图标,这怎么实现,好的话100分!

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

Option Explicit
Const REG_SZ As Long = 1
Const HKEY_LOCAL_MACHINE = &H80000002
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function