I created an easy way to enable/disable one of the mice attached to my computer. When VirtualBox is running, that mouse is captured within VB (for my daughter to play with). However, when VB isn't running, I don't want that mouse interfering with my mouse, so I created a batch file to enable and disable it using Microsoft's devcon utility. Unfortunately, the legal way to get it is to download the huge WDK (Windows Driver Kit).

My wife's new HP Envy, which has Windows 8.1, doesn't have a way to disable its touchscreen or touchpad. So I wanted to use a variatoin of my script to do that as well. (In the end, I got the script to work for the touchscreen, but not the touchpad... which is run by a different kind of driver so needs a different method).

Under Windows 8, this worked in a simple batch file:

    devcon.exe enable "USB\VID_046D&PID_C501"

 

I did not even need to elevate to admin priveleges for that to enable/disable the mouse.

I updated to 8.1 last night and the batch file stopped working. Using the same batch file, devcon SAYS it enabled the device (below), but the mouse was actually NOT enabled if I tried to move it around (and vice versa if I enabled it in Device Manager and then tried to disable via devcon... it did not disable). I could enable/disable perfectly fine in the Device Manager GUI.

    USB\VID_046D&PID_C501\5&3514F6C9&0&1                        : Enabled
    1 device(s) are enabled.

 

I made sure I was using the x64 version of devcon on my x64 Windows 8.1. I tried doing it as elevated to admin rights as well as not elevated (both for the batch file and devcon itself). I also tried it in a few different compatibility modes.

I googled and googled and did not find anyone else having an issue with devcon on 8.1 and all of the example I saw matched what I was already doing.

I decided to read through the help screen again, and I saw the restart command. Once I put it after the enable/disable command, it started working. Finally.

    devcon.exe enable "USB\VID_046D&PID_C501"
    devcon.exe restart "USB\VID_046D&PID_C501"

 

The restart command requires elevation to admin rights. So I created two shortcut files to the batch file (one to enable and one to disable) and set the shortcuts to run as administrator. And then I use the shortcuts to run the batch file.
 
Tags

Detecting MouseEnter and MouseLeave in a control that has lots of children controls (.Net)

Seems like I have been through this before. What I want to do is hide and show something, depending on whether the mouse is inside of a certain area. For instance, I have a container of some sort with lots of controls on it. When the mouse is anywhere inside of the container, I want a link to be visible. I can't simply use the MouseEnter/MouseLeave events on the container, because MouseLeave is triggered when the mouse enters a child control and the MouseEventArgs don't say anything about what control is being entered.

Say Goodbye to Windows 8's Start Screen

 

All of the people I've talked to who don't like Windows 8, don't like it because of the new start screen. You know, the tiled "apps" screen. A.K.A. "Metro" screen.

Maybe that sort of thing makes sense on a touchscreen device. Not on a desktop computer or standard laptop.

This free software brings back your start menu, like in Windows 7: ClassicShell. If you set it to start in desktop mode, you can say goodbye to the start screen! Here's how.