to jiangsheng 我现在就是用的类似的SETUP API,但现在的问题是SETUP API需要将硬件插入计算机,这样就会弹出新硬件对话框,在多国语言里怎么去评比这些对话框?现在这个问题已经有了一个解决办法但不是太好,应该有更好的办法to billy145533 那是不就是说所有未经过数字签名的驱动都不会被当作系统自动选择时的“最合适驱动”也就是说即使已经将驱动拷贝到系统目录下,安装程序也不会自动匹配这个驱动呢?to alphapiao 谢谢你的方法,我要试一下,现在问题是只在注册表里面更改这一项是不是不够呢,因为我看到INF文件里面有很多写注册表的项
You can automate the Find New Hardware dialog with FindWindow and SendInput
to jiangsheng: you said that i can find the "Find New Hardware" dialog with FindWindow fuction then use SendInput to close it .we must know the caption of dialog which will pop up when the system find a new device. but this sw will be probably used under the system with any language not only english and chinese,so we must gain strings of the dialog's caption in all languages. i think this is impossible
(1)设备插入系统,USB总线驱动向内核PnP管理器报告有新设备接入系统;
(2)内核PnP管理器向USB总线驱动询问设备的具体信息,比如PID和VID等;
(3)内核PnP管理器将设备的信息报告给用户层的PnP管理器,并要求它为新设备安装驱动;
(4)用户层PnP管理器调用系统的Setup组件来为设备安装驱动;
(5)Setup使用设备VID和PID到%Windir%\\inf下寻找适合它的inf文件,并获得一个可用于设备的驱动程序列表;
(6)Setup在生成驱动程序列表的时候,会检查inf文件是否经过数字签名,如果没有经过数字签名,
Setup会将此inf文件负责安装的驱动程序设置成“不可信任的”驱动程序;
(7)Setup对驱动程序列表中的各驱动程序信息进行分析,选择最匹配设备的驱动程序进行安装;
http://xpddk.bokee.com/viewdiary.12932439.html
you said that i can find the "Find New Hardware" dialog with FindWindow fuction then use SendInput to close it .we must know the caption of dialog which will pop up when the system find a new device.
but this sw will be probably used under the system with any language not only english and chinese,so we must gain strings of the dialog's caption in all languages.
i think this is impossible