• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Found New Hardware

sm625

Diamond Member
You've seen the message

jiminstall.jpg


I need to find a way to know that windows is doing this, because if you try to talk to a usb HID device before it finishes installing the plug and play driver, it will pop up an even more annoying message:

CTX132721-1.gif


And I definitely do not want that box popping up! So, is there a way to find out if windows is installing new hardware, maybe some process I can scan for?

edit: SOLVED. I used WINAPI CreateToolhelp32Snapshot to determine if (and how many instances of) the rundll32.exe process was running. I then searched each one for setupapi.dll.
 
Last edited:
You've seen the message

jiminstall.jpg


... is there a way to find out if windows is installing new hardware, maybe some process I can scan for?

I am not entirely sure of what you are asking, but if you click on that popup, Windows will tell you what it is installing.

If you put the same USB device in the same USB port every time, you should, at most, see the first message only.
 
it is probably Plug and Play service. But you probably don't want to touch this. It is too risky, might end up with system that does not respond to kb and mouse.
 
I dont want to mess with it, I just need a way to programmatically tell that it is installing new hardware, so I can tell my software to wait before it talks to the hardware. As long as I wait, I will not get that box saying it needs to restart. I just dont want to make it wait unless absolutely necessary.
 
I dont want to mess with it, I just need a way to programmatically tell that it is installing new hardware, so I can tell my software to wait before it talks to the hardware. As long as I wait, I will not get that box saying it needs to restart. I just dont want to make it wait unless absolutely necessary.

What software are you referring to?
 
It's my software. It uses a HID driver to talk to a HID device. I can make it wait before attempting to talk to the device, if I knew windows was doing its found new hardware routine.

I've narrowed it down to rundll32.exe and setupapi.dll. Now I just need a way to tell if that process is running, and if it has that dll loaded. I have used "EnumProcesses" in the past, so that might lead to a solution.
 
Last edited:
Back
Top