Hi Guys,

I'm writing a Windows Forms application in VB.Net 2010. The application's purpose is to recreate the Device Manager in VB.Net. The idea here is to capture the information provided by Device Manager and store it in a database. In turn this information could be used as a configuration management tool.

My device tree is coming along nicely, with one minor exception. There are hidden devices that Device Manager does not display by default. Show Hidden Devices causes Device Manager to display these devices. My Device Manager displays them by default. I want to duplicate the Device Manager behavior of being able to hide and display these devices in my appilcation. I have had some success with this task in that I am able to hide the Plug and Play devices that are marked as hidden by windows by use of the "Don't Display In DM" flag. There is the small issue of the Non Plug and Play Device Class. My question is this... Is there a similar flag for Non Plug and Play devices? I have found a reference to the PNP_DEVICE_STATE and IRP_MN_QUERY_PNP_DEVICE_STATE IRP. It contains a flag

PNP_DEVICE_DONT_DISPLAY_IN_UI. My problem is that I cannot find any guidance as to the structure of this API declare and the coding needed to use it. I'm not even sure if this API will be helpful in accomplishing my task. I want to hide the Non Plug and Play devices and device class in my tree. Can someone please assist me with the locating an API that will accomplish this and the proper coding of the API in VB?

I am using Visual Studio 2010 Ultimate and Running Windows 7 Ultimate with all Service Packs and updates applied.