-
BlockInput(true) help
Hi guys,
Im having trouble working the BlockInput(); command.
Here is my code:
Code:
#include <windows.h>
#include <winable.h>
#include <stdio.h>
using namespace std;
int main(){
Sleep(1000);
BlockInput(true);
Sleep(5000);
BlockInput(false);
return 0;
}
It compiles and runs fine, but it will not block the mouse or keyboard.
-
Mmkay. What do you imagine that we can deduce from this trouble report that can help you?
-
I'm not entirely sure why you think it's not working -- what does the program do, after all? -- but I can say this: just for fun, I compiled this with codeblocks, which does a press any key... bit after the program ends. Keys I pressed right away did close the window, but if I waited a couple of seconds, those keys were ignored. Make of that what you will.
-
It does everything but block the mouse or keyboard input i can still use both while it is running
-
Lemme guess. You want it to block everything for every application?
-
yes.
You can tell that im a newbie, so if you want to take the p........ then you can do.
-
Code:
cout << "Smash your keyboard and mouse with a hammer.\n"
As my example showed (at least in my mind), BlockInput is blocking keyboard input, but only for that program.
-