what i want to do is have a background application which by itself or its modules run only when a certain key is pressed. Like when i press F10 some code that i have written executes and then quits or goes to sleep then again when i press F10 i executes again and goes to sleep but in between keystrokes it does not takes any processor time. How can i do it
For example a thread that executes its statements and then
thread.Sleep( "till i press F10" );
well this is an imaginary function. Any help from the real world :)
C# + Winforms