谁能给个PDEVICEPROPERTIES的使用的例子或者PDEVICEPROPERTIES的说明啊,谢谢呀
解决方案 »
- 菜鸟 求助关于ODBC查询
- 如何获取其他非本进程对话框内的密码控件中的密码文本?
- c++ vc学习讨论群:14897958
- 怎么将图片嵌入至登陆界面?
- WinSock API中关于char的问题
- 我想在listbox里增添edit,combo控件,,请问高手指点(实在没分拉.,以后肯定补上)
- 如何将char sn[8]内容形成一个字符串并输出。急,50分。
- 有人知道怎么把PDF格式里的字转化为字符吗?有什么工具吗?谢谢!!!
- 会做ATL Service 的人,情教教我,谢谢!最好斑竹来帮帮忙.
- 请问:怎样在SDI一启动就调入Windows资源管理器
- 列表框分栏问题
- 如何根据网卡地址,获取机器名或IP
Invoking a Device Properties Dialog Box Programmatically in an Installation Application
To invoke the device properties dialog box programmatically in an installation application, the application code should do the following:Include macro definitions and type definitions in the application code that ensure that the appropriate version of DeviceProperties_RunDLL is linked when the application is built. Setup supports a Unicode version and an ASCII version.Load devmgr.dll.
Obtain a pointer to the DeviceProperties_RunDLL function.
Call DeviceProperties_RunDLL, supplying the appropriate parameters.
The following code example shows how to define a pDeviceProperties function pointer that references the DeviceProperties_RunDLL function. If the _UNICODE macro is defined when the code is complied, pDeviceProperties is a pointer to the Unicode version of the function; otherwise pDeviceProperties is a pointer to the ASCII version of the function.#ifdef _UNICODE
#define DeviceProperties_RunDLL "DeviceProperties_RunDLLW"
typedef void (_stdcall *PDEVICEPROPERTIES)(
HWND hwndStub,
HINSTANCE hAppInstance,
LPWSTR lpCmdLine,
int nCmdShow
;
#else
#define DeviceProperties_RunDLL "DeviceProperties_RunDLLA"
typedef void (_stdcall *PDEVICEPROPERTIES)(
HWND hwndStub,
HHINSTANCE hAppInstance,
LPSTR lpCmdLine,
int nCmdShow
);
#endifPDEVICEPROPERTIES pDeviceProperties;The following code example uses the definition of pDeviceProperties that was provided in the preceding code example and shows how to load devmgr.dll programmatically and how to obtain the function pointer to the appropriate version of DeviceProperties_RunDLL.HINSTANCE hDevMgr = LoadLibrary(_TEXT("devmgr.dll"));
if (hDevMgr) {
pDeviceProperties = (PDEVICEPROPERTIES)GetProcAddress((HMODULE)hDevMgr, DeviceProperties_RunDLL);
}After obtaining a pDeviceProperties function pointer, you must supply a computer name and device instance identifier in a call to DeviceProperties_RunDLL. The following code example illustrates the appropriate format and requirements for these items:(Windows XP and later only) An optional machine-name-parameter field is not supplied, which indicates, by default, that the computer is the local computer. A required device-instance-ID-parameter field supplies the device instance identifier "root\system\0000".
if (pDeviceProperties){
pDeviceProperties(m_hWnd, NULL, _TEXT("/DeviceID root\\system\\0000"), NULL);
};(Windows XP and later only) An optional machine-name-parameter field is not supplied, which indicates, by default, that the computer is the local computer. A required device-instance-ID-parameter field supplies the device instance identifier "PCI\VEN_8086&DEV_2445 &SUBSYS_010E1028&REV_12\3&172E68DD&0&FD".
if (pDeviceProperties){
pDeviceProperties(m_hWnd, NULL, _TEXT("/DeviceID PCI\\VEN_8086\&DEV_2445\&SUBSYS_010E1028\&REV_12\\3\&172E68DD\&0\&FD"), NULL);
};
(Windows 2000 and later) A required machine-name-parameter field supplies a pair of double quotation s ("") for machine-name, which indicates that the computer is the local computer. A required device-instance-ID-parameter field supplies the device instance identifier "root\system\0000".
if (pDeviceProperties){
pDeviceProperties(m_hWnd, NULL, _TEXT("/MachineName \"\" /DeviceID root\\system\\0000"), NULL);
};
(Windows 2000 and later) A required machine-name-parameter field supplies the remote machine name "\\RemoteMachineAbc" and a required device-instance-ID-parameter field supplies the device instance identifier "root\system\0000".
if (pDeviceProperties){
pDeviceProperties(m_hWnd, NULL, _TEXT("/MachineName \\\\RemoteMachineAbc /DeviceID root\\system\\0000"), NULL);
};© 2006 Microsoft Corporation
Send feedback on this topic
Built on October 19, 2006