Detecting plug'n'play

  • Thread starter Thread starter Georges Berenger
  • Start date Start date
G

Georges Berenger

The first time the machine is powered up after a software install or a
hardware change (new device, could it be USB or not), the new devices
are discovered by the PnP mechanism. It works fine, with one caveat: it
completes long after my software has been launched and failed, because
the drivers weren't installed properly, yet.
All I need to do is restart the software, sometimes the OS as well, and
everything is happy. But the user experience is not very good. Why
doesn't the mouse/trackball work? etc.

I'd need a way to detect that PnP is running, so that I can pause my app
until PnP has finished its work, possibly display a message a user
requesting his patience.
Of course, I'd also need a way to know when PnP has finished, and if I
should restart or not.

Any idea anyone?

-georges
 
Hi Georges,

You have even more difficult questions than me :-)
Of course, I'd also need a way to know when PnP has finished, and if I
should restart or not.
Any idea anyone?


DDK: Device Installation CMP_WaitNoPendingInstallEvents.

I had other things to do so I haven't tried this yet, but it is on my long
to do list.
Please let me know how it worked.


Let luck and knowledge guide you,

Slobodan
 
Slobodan said:
Hi Georges,

You have even more difficult questions than me :-)





DDK: Device Installation CMP_WaitNoPendingInstallEvents.

I had other things to do so I haven't tried this yet, but it is on my long
to do list.
Please let me know how it worked.

that works just fine.
Because it requires the use of the DDK, and I'd rather avoid this (this
doesn't fit well in our multi-developer environment), I have decided to
load the dll manually & call the function directly. No problem.

Many thanks for the info!
-georges
 
Back
Top