Shell "C:\windows\system32\control.exe desk.cpl", vbNormalFocus
或
Shell "rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3"
可以打开“显示 属性”对话框,但我想跳过这一步直接用代码打开其中由“设置-->高级”弹出的“(xx监视器)和NVIDIA FeForce xxxx 属性”对话框,请问能否实现?最好别用sendkeys之类,api之类可以。
11 个解决方案
#1
资料没找到,反汇编无果(菜菜)。
不得已的方法:FindWindow + SendMessage
不得已的方法:FindWindow + SendMessage
#2
支持
#3
要直接打开的话,就不清楚了.
这个对话框的资源我没有在desk.cpl里面找到...
在没有找到"直接打开"的办法前,我也支持1楼老魏的做法~~
#4
我想反汇编跟踪一下那个按钮调用的api,结果连事件过程入口都没找到,地址直接为FFFFxxxx。
#5
先做个记号,关注一下。
#6
老马,你想找的东东在 Systm32\themeui.dll 中,资源 ID 为 1007 的 Dialog
它没有在 desk.cpl 中。
我想看一下你如何对它开刀 ^_^
#7
这个只是对话框的模板,Windows调用的时候要做很多处理,所以对我们来说用途不大。
另外附送vb调用该对话框资源的源码:
Option Explicit
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Public Declare Function CreateDialogParam Lib "user32.dll" Alias "CreateDialogParamA" (ByVal hInstance As Long, ByVal lpName As Long, ByVal hWndParent As Long, ByVal lpDialogFunc As Long, ByVal lParamInit As Long) As Long
Public Const SW_SHOW As Long = 5
Public Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const WM_SYSCOMMAND As Long = &H112
Public Const SC_CLOSE As Long = &HF060&
Public Declare Function EndDialog Lib "user32.dll" (ByVal hDlg As Long, ByVal nResult As Long) As Long
Public Declare Function GetMessage Lib "user32.dll" Alias "GetMessageA" (ByRef lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Public Declare Function TranslateMessage Lib "user32.dll" (ByRef lpMsg As MSG) As Long
Public Declare Function DispatchMessage Lib "user32.dll" Alias "DispatchMessageA" (ByRef lpMsg As MSG) As Long
Public Declare Sub PostQuitMessage Lib "user32.dll" (ByVal nExitCode As Long)
Public Type POINTAPI
x As Long
y As Long
End Type
Public Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Public Function DialogProc(ByVal hwndDlg&, ByVal uMsg&, ByVal wParam&, ByVal lParam&) As Long
If uMsg = WM_SYSCOMMAND Then
If wParam = SC_CLOSE Then
Call EndDialog(hwndDlg, 0)
PostQuitMessage 0
DialogProc = 0
End If
End If
End Function
Public Sub Main()
Dim hDlg&
Dim tMsg As MSG
Dim hIns&
hIns = LoadLibrary("themeui.dll")
hDlg = CreateDialogParam(hIns, 1008, 0, AddressOf DialogProc, 0)
FreeLibrary hIns
ShowWindow hDlg, SW_SHOW
While GetMessage(tMsg, 0, 0, 0)
Call TranslateMessage(tMsg)
Call DispatchMessage(tMsg)
Wend
End Sub
#8
UP
#9
看来这个问题不好搞定呀。
#10
不会,帮顶
#11
不会,帮顶
#1
资料没找到,反汇编无果(菜菜)。
不得已的方法:FindWindow + SendMessage
不得已的方法:FindWindow + SendMessage
#2
支持
#3
要直接打开的话,就不清楚了.
这个对话框的资源我没有在desk.cpl里面找到...
在没有找到"直接打开"的办法前,我也支持1楼老魏的做法~~
#4
我想反汇编跟踪一下那个按钮调用的api,结果连事件过程入口都没找到,地址直接为FFFFxxxx。
#5
先做个记号,关注一下。
#6
老马,你想找的东东在 Systm32\themeui.dll 中,资源 ID 为 1007 的 Dialog
它没有在 desk.cpl 中。
我想看一下你如何对它开刀 ^_^
#7
这个只是对话框的模板,Windows调用的时候要做很多处理,所以对我们来说用途不大。
另外附送vb调用该对话框资源的源码:
Option Explicit
Private Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Public Declare Function CreateDialogParam Lib "user32.dll" Alias "CreateDialogParamA" (ByVal hInstance As Long, ByVal lpName As Long, ByVal hWndParent As Long, ByVal lpDialogFunc As Long, ByVal lParamInit As Long) As Long
Public Const SW_SHOW As Long = 5
Public Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const WM_SYSCOMMAND As Long = &H112
Public Const SC_CLOSE As Long = &HF060&
Public Declare Function EndDialog Lib "user32.dll" (ByVal hDlg As Long, ByVal nResult As Long) As Long
Public Declare Function GetMessage Lib "user32.dll" Alias "GetMessageA" (ByRef lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Public Declare Function TranslateMessage Lib "user32.dll" (ByRef lpMsg As MSG) As Long
Public Declare Function DispatchMessage Lib "user32.dll" Alias "DispatchMessageA" (ByRef lpMsg As MSG) As Long
Public Declare Sub PostQuitMessage Lib "user32.dll" (ByVal nExitCode As Long)
Public Type POINTAPI
x As Long
y As Long
End Type
Public Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Public Function DialogProc(ByVal hwndDlg&, ByVal uMsg&, ByVal wParam&, ByVal lParam&) As Long
If uMsg = WM_SYSCOMMAND Then
If wParam = SC_CLOSE Then
Call EndDialog(hwndDlg, 0)
PostQuitMessage 0
DialogProc = 0
End If
End If
End Function
Public Sub Main()
Dim hDlg&
Dim tMsg As MSG
Dim hIns&
hIns = LoadLibrary("themeui.dll")
hDlg = CreateDialogParam(hIns, 1008, 0, AddressOf DialogProc, 0)
FreeLibrary hIns
ShowWindow hDlg, SW_SHOW
While GetMessage(tMsg, 0, 0, 0)
Call TranslateMessage(tMsg)
Call DispatchMessage(tMsg)
Wend
End Sub
#8
UP
#9
看来这个问题不好搞定呀。
#10
不会,帮顶
#11
不会,帮顶