Original Post
I have a keyboard hook set up. I''m monitoring for Alt+L. The hook picks up the Alt+L well enough, but it executes the code for it twice.
//PRESSED IS A BOOL THAT IS ASSIGNED FALSE AT APP INIT
if (hooked->vkCode==0x4C && hooked->flags & LLKHF_ALTDOWN)
if(!PRESSED)
{
messageBox(NULL, "BOO","BOO", MB_OK);
PRESSED=TRUE;
GetPassword();
if (result==TRUE)
UnlockStation();
Sleep(20);
PRESSED=FALSE;
}
I''ve tried using a BOOL flag to prevent it from being executed twice, but this doesn''t seem to help either... Am I doing something wrong? How could I fix this?