Re: polling keyboard and mouse drives cpu utilization to 99%

From: James Black (jblack_at_ieee.org)
Date: 10/26/04


Date: Tue, 26 Oct 2004 12:13:50 -0400


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Black wrote:
| I am using DirectX9.0b for this application at the moment, and recently
| (since my July build I guess) started to have a problem.
|
| My window service needs to check if there was any keypresses or mouse
| movements else it starts up an application, but, the moment I check for
| anything from the keyboard or mouse the utilization goes to 99%.
|
| I am including my code that is called, to see if someone can help me
| understand what is going on.
|
| My application still functions, it's just that it functions slower than
| it should, but the window service isn't locked up.
|
| Thanx.
| catch (DirectXException)
| {
| bool loop = true;
| do
| {
| try
| {
| applicationDevice.Acquire();
| }
| catch(InputLostException)
| {
| loop = true;
| }
| catch(InputException inputException)
| {
| ie = inputException;
| loop = false;
| }
| }while (loop);

~ I am wondering if this is the problem area, since the problem only
comes up when the machine is rebooted. When the window service is
started it works fine, when the OS starts the window service it is
messed up.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBfne9J/zyYkX46joRAtvgAJ0WndTHDNSD0jFN1Uu5b9B7MP5VTACfWoXf
K5ClZT49NJ9ax0p4S5mC24I=
=6e/6
-----END PGP SIGNATURE-----



Relevant Pages