Tate Admin
Posts : 208 Reputation : 17 Join date : 2009-09-19 Age : 27
| Subject: Basic 'Block User Input' program. Fri Nov 27, 2009 3:19 pm | |
| This program disables the mouse and keyboard's input for 5 seconds. first type your includes: - Code:
-
#include <windows.h> #include <winable.h> #include <stdio.h> Next create your main: (ill put comments in) - Code:
-
int main() { Sleep(1000);//pause for 1000 milliseconds (one second), before it blocks input BlockInput(true);//blocks input Sleep(5000);//pauses for 5000 milliseconds (5 seconds), before it unblocks input BlockInput(false);//unblocks input return 0;//ends program } Source Code: - Code:
-
#include <windows.h> #include <winable.h> #include <stdio.h>
int main() { Sleep(1000); BlockInput(true); Sleep(5000); BlockInput(false); return 0; } You do NOT need to add - Code:
-
using namespace std; for this part of the code, or at least in dev C++. If you want to add it, that's fine, it will still work. (and you can add console commands, etc.) This is for educational purposes only. | |
|