At long last, decent G-Sensor functionality for my WindPad 110W
I have decided to write today's blogpost in English because it might affect an international audience, namely those people who, like me, have purchased an MSI WindPad Tablet in the hope to get it running with Windows 8 smoothly.
(Update (2012/10/10): Version 1.0.13.0 is available under the download link below. Just update from 1.0.7.0 or do a fresh install and all problems with MSI's dual camera app should be gone)
Short abstract: I have written a decent G-Sensor App for the MSI WindPad 110W tablet computer which works nicely under Windows 8 even with the newfangled Windows 8 UI (formerly dubbed "Metro") running. You can grab it here: Download wpdgspot. Full source code for the wpdgspot binary is available here.
Longer essay: The MSI WindPad 110W is a nice piece of hardware. I bought mine sort of like a year ago to have a tablet computer to run the various Windows 8 previews, betas and RCs. Unfortunately, the G-Sensor ("G" as in "Gravity") in this tablet computer, which is supposed to make the screen rotate while the user rotates the tablet computer, does not adhere to the new Windows 8 hardware standards. Incidentally, this tablet computer ships with Windows 7 and a companion software package from MSI is available that includes an application that works with the G-Sensor in the tablet. That software package is called "O-Easy" and the particular application that rotates the screen is MSIGSensorHid.exe which is added to the run key in the registry so it is started after each user login. And this software sucks big time.
The problem with MSIGSensorHid.exe is, that it only works on Windows 8 while a desktop application is running in the foreground. If a new Windows 8 UI application is running (aka "Metro App"), it doesn't rotate the screen while the user rotates the tablet computer. Bummer!
Since non-working G-Sensor functionality renders a Windows 8 tablet computer almost useless, I decided to rewrite the G-Sensor app and create one that is much better than the one that MSI ships.
How do you go about rewriting such an app? Fortunately MSI made this quite easy for me. If you run spy++ (a development tool that should be familiar to every windows programmer), you will notice that while MSIGSensorHid.exe is running, a hidden top level window with tons of child controls exists. So you only need two lines of code (FindWindow and ShowWindow, that is) in an application of your own to show this hidden top level window:
(click on the image for a higher resolution image in a separate browser window)
From there you can easily determine the USB Vid/Pid of the sensor, and monitor the HID data exchange between the application and the sensor device. Now some further reading on MSDN about HIDs (Human Input Devices) and you are halfway done with your own application. But wait, what is this if we watch with process explorer what the app is doing?
(click on the image for a higher resolution image in a separate browser window)
Not only doesn't it work properly on Windows 8, after a few minutes it has 509 threads running, half a Gigabyte of committed memory from the pagefile (which is quite a lot on a machine with only 2GB of RAM) and more than 3000 handles. And this app is doing nothing than wait for a user to rotate the screen! This is just insane. Further investigation reveals that this app is creating one thread per second until the thread pool of the app domain is exhausted. Oh my dear, how peculiar!
On the screenshot above you also see the numbers for my replacement app, wpdgspot.exe: 2 threads, 84 handles, 808k of private bytes.
It took me a week's evenings work to write this app, and I spent most of the time thinking about a funny name for this pet project. I came up with wpdgspot (which you may pronounce "Whipped G-Spot" if you like). The "wpd" is derived from "WindPad" and since the "G" as in "G-Sensor" or "Gravity-Sensor" is also in the word "G-Spot" and since the "G-Spot" is considered a sensory receptor (at least this is what wikipedia says about the whole topic), I decided to give it this name.
How to install it:
Download the msi file (no pun intended) for the "Whipped G-Spot" from the download link. Bring your WindPad 110W into horizontal position and now install the msi file. Log out while in horizontal position and log in again. MSIGSensorHid.exe will now be gone and wpdgspot will be running instead. You have to do the installation in horizontal position because MSIGSensorHid.exe will always store the rotation position permanently which wpdgspot.exe does not by design. So we have to make MSIGSensorHid.exe save the horizontal position for the very last time it runs now, so the horizontal position is the one that is saved permanently but from now on changed dynamically by wpdgspot without permanent persistence while you are using the tablet computer.
Update (2012/10/10): I have adopted MSI's way of changing the screen rotation "permanently" with version 1.0.13.0 because it creates less hassle for everyone when installing over an existing O-Easy installation and it is a per-user setting anyway. Their choice wasn't that bad after all in that case.
How to build it on your own:
Download the source code, unpack it recursively. You need Visual Studio 2010 (Express edition should suffice) in order to build it, and a recent windows DDK (I used the Windows 7 DDK). Create a new environment variable "WINDDKDIR" which points to your DDK installation and now launch the solution file with Visual Studio and build the whole shebang. You have the right to inspect the source code, learn from it, find errors in it (and tell me about them), build it for your own purposes, but not to distribute it, sell it or distribute binary derivatives of wpdgspot.
Limitations:
I have only tried to run the "Whipped G-Spot" app on Windows 8 RTM x86. I assume it also runs well on Windows 7 and all x64 versions of Windows 7 and Windows 8. I would welcome any report of success on these OS versions as well as reports of this software on other variants of the WindPad tablet family.
Update (10/10/2012): People on the MSI forum have run wpdgspot.exe successfully with their windpad device on Windows 8 x64 RTM. I have successfully tested on Windows 7 x64, so I think we are good to go on all relevant platforms with my x86 build of wpdgspot.exe.
Trackback address for this post
14 comments
I wish I could thank you in person , please help MSI by giving them what you made , you'll be helping thousands
it works ever ssooo smoothly!!!
u must give it to MSI..its a moral obligation 😁
A MSI WindPad owner who also happens to be a knowledgeable programmer1.
Congratulations and thanks!
Q: will your app install and work on win7 too, oe does it use any win8 specific APIs?
I dislike bloated, inefficient code and as you found MSI s code sucks royally, so I'd like to replace the MSI sensors app w your own, even while I prefer to keep Win7...
Just looking at o-easy.exe using 80MB of RAM makes my blood boil....
while grabbing the tablet from the right side, some of my hand inevitably lands on top of the o-easy button area when I dont want to...
it would be great if aome 3rd party util would allow turning that area sensitivity on/off... for instance if I tap 4 times in a row over any of the soft-buttons, disable it, and if I tap 4 times again, enable it.
What do you think?
Kudos from down under...
FC
In the words of Mike Magee.... "send them an invoice!!" :-))
FC
As to your question about the soft buttons: Take a look at the source code for my project "So lazy". I guess you can hook quite a number of the soft buttons with the exception of the SAS (the Ctrl-Alt-Del Key combo soft button).
Now to look for that elusive "so lazy" project. :)
FC
Now my WindPad works fine on Win10.
This post has 6 feedbacks awaiting moderation...