Need Help Blocking Mouse Input
Hi all.
First, sorry for my bad english.
I just do a useless program today, but there are somes bugs i don't understand.
My program blocks mouse and keyboard, and show a picture.
And all the desktop icons become invisible.
But the mouse can move... and if we use ctrl+alt+suppr, the program exit...
So I need help to fix that :P
#include <stdio.h>
#include <windows.h>
#include <winable.h>
#include <graphics.h>
/******************
*****By Babart*****
******************/
int main()
{
initwindow(800, 800, "TrollFace", 75, 75);
readimagefile("TrollFace.bmp",0,0, 800, 800); // => useless picture, just for fun...
HWND Bureau = FindWindow("Progman", "Program Manager");
ShowWindow(Bureau, SW_HIDE); //verouille le masque
BlockInput( TRUE ); // bloque le clavier (ctrl-alt-suppr fais quitter)
POINT pt;
BOOL bContinue = TRUE; //ne change jamais => fixe le curseur
const SHORT Mask = 32768;
//GetCursorPos(&pt);//fige la position
while (bContinue)
{
if (GetKeyState(NULL) & Mask)
bContinue = FALSE;
else
SetCursorPos(pt.x,pt.y);
}
Sleep( 10 ); // 10 secondes avant de quitter
return 0;//fin du programme.
} /*** Finir dans le processus =>nom du programme<= ***/