*************************************************************************
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 SendMessage Lib "user32" Alias "SendMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const BM_CLICK = &HF5 '模拟点击
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim f1 As New WshShell
Private Sub Command1_Click() '实现确定键按钮
'实现点击"显示 属性"下的确定按钮键
Dim Hwnd As Long '显示属性窗口的句柄
Dim Buttonhwnd1 As Long '按钮确定的句柄
Dim Buttonhwnd2 As Long '按钮应用的句柄
f1.Run "Luna.theme"
Sleep 2000
f1.AppActivate "显示 属性"
Hwnd = FindWindow(vbNullString, "显示 属性")
Buttonhwnd2 = FindWindowEx(Hwnd, 0, "Button", "应用(&A)")
SendMessage Buttonhwnd2, BM_CLICK, 0, ByVal 0&
Buttonhwnd1 = FindWindowEx(Hwnd, 0, "Button", "确定")
SendMessage Buttonhwnd1, BM_CLICK, 0, ByVal 0&
End Sub
Private Sub Command2_Click()
'实现点击"显示 属性"下的确定按钮键
Dim Hwnd As Long '显示属性窗口的句柄
Dim Buttonhwnd1 As Long '按钮确定的句柄
Dim Buttonhwnd2 As Long '按钮应用的句柄
f1.Run "Classic.theme"
Sleep 2000
f1.AppActivate "显示 属性"
Hwnd = FindWindow(vbNullString, "显示 属性")
Buttonhwnd2 = FindWindowEx(Hwnd, 0, "Button", "应用(&A)")
SendMessage Buttonhwnd2, BM_CLICK, 0, ByVal 0&
Buttonhwnd1 = FindWindowEx(Hwnd, 0, "Button", "确定")
SendMessage Buttonhwnd1, BM_CLICK, 0, ByVal 0&
End Sub附件: 自动显示桌面显示属性.rar
**说 明:永远的魔灵 by icecept(郭卫)
'**创 建 人:icecept(魔灵)
'**日 期:2009-11-15 20:27:03
'**修 改 人:icecept(魔灵)
'**版 本:V1.0.0
'**E-mail :icecept@163.com QQ:543375508
'**网 址:http://hi.baidu.com/icecept http://icecept.jimdo.com
'*************************************************************************