You need to setup a Windows low-level keyboard hook and capture the keypresses there. Here is example code:
Code:
LRESULT CALLBACK LowLeveKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if(nCode == HC_ACTION)
{
int eatKeyPress = 0;
switch(wParam)
{
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
{
PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT)lParam;
// capture alt space
if(p->vkCode == VK_SPACE && (p->flags & LLKHF_ALTDOWN))
{
eatKeyPress = 1;
}
break;
}
}
}
return(eatKeyPress ? 1 : CallNextHookEx(NULL, nCode, wParam, lParam));
}
int main(void)
{
SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandle(0), NULL);
printf("While this app is running, alt+space is disabled");
char c = getchar();
return(1);
}
i havent' compiled it, but it should give you an idea of the kind of thing you need to do... if it doesn't work, play and fiddle with it til it does!
good luck
U.