Changing the thread priority worked!!! I bumped my program down to idle and viola. Thanks guys. Here is a little more about my program to clear some things up if you are interested.
My program doesn't have focus, so windows doesn't send it a WM_KEYDOWN message or anything. So, I set up a WM_TIMER message for every second and GetAsyncKeyState() to check the state of the key I am interested in. The file has to be written every second because this is for a program to help time events to a resolution of one second. I don't know if this matters, but only 20 characters or so get written.
All that doesn't matter though, because if I take all the file writing leaving just the skeleton the program still races through eating up resources causing the game to run poorly.
here is the snippet of code that is at the heart of my program wanting my processor all to itself
/*********************************
// This snippet ganked from "prima tech's 'the zen of
// direct3d game programming' by Peter Walsh"
// I liked the book
// Start the message loop
while( TRUE )
{
// Check if a message is waiting for
//processing
if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
// Check if the message is to quit
// the application
if( msg.message == WM_QUIT )
// Exit the message loop
break;
// Change the format of certain
// messages
TranslateMessage( &msg );
// Pass the message to WndProc()
//for processing
DispatchMessage( &msg );
}
}
***************************************************/
I originally had the code another way, which wouldn't eat up resources, however then the WM_TIMER events weren't handled for whatever reason. It looked like this.
/****************************************************
// This snippet also ganked from "prima tech's 'the zen of
// direct3d game programming' by Peter Walsh"
// I liked the book
// Start the message loop
while( GetMessage( &msg, NULL, 0, 0 ) )
{
// Modify key messages
TranslateMessage( &msg );
// Send the message to WndProc() the event
// handler
DispatchMessage( &msg );
}
*****************************************************/
Thanks again guys for your help.