Я пишу небольшое приложение С#, чтобы отключить устройство (сенсорную панель ноутбука), когда обнаружено другое устройство мыши, и снова включить сенсорную панель, если мышь не обнаружена. Я даже не могу отключить тачпад в диспетчере устройств (он работает в драйвере класса мыши по умолчанию).
Я попадаю в разработку драйверов устройств, поэтому я подумал, что, возможно, я могу написать небольшой фильтр-драйвер, который просто примет IOCTL для включения и отключения передаваемых сообщений о событиях мыши в стеке устройств и получения сообщений из пользовательского режима через необработанный PDO. Однако я задал этот вопрос, и кто-то предположил, что я могу сделать это в usermode через SetupDi.. функции. Это было бы очень хорошо, потому что этот необработанный метод связи PDO - это PITA для работы.
Я использовал только SetupDiGetClassDevs раньше, и их так много, может кто-то с большим опытом работы с этой частью API Win32 просто скажите мне, что я должен был бы вызвать, чтобы остановить/отключить устройство мыши или его интерфейс или если есть что-то где-то в темных углах рамки, которые это сделают (возможно, в WMI?).
Обновление (24/9/09) Я выяснил, как это сделать с драйвером фильтра и опубликовал, как я это сделал на мой оригинальный вопрос. Я все еще хочу знать, можно ли включать или отключать устройства непосредственно из Win32, и если да, то как же, я оставлю этот вопрос открытым.