con un hook de teclado.. has que tu aplicacion llame a otra aplicacion con este codigo que bloquerá la tecla 'n'
programa "oculto" que bloquea la tecla
#include<windows.h>
LRESULT CALLBACK hookKey(int nCode, WPARAM wParam, LPARAM lParam) {
PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) (lParam);
if (wParam == WM_KEYDOWN) {
switch (p->vkCode) {
case 'N': return 3;
}
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
int main()
{
HANDLE hModule=GetModuleHandle(NULL);
HHOOK hook = SetWindowsHookEx(WH_KEYBOARD_LL,hookKey,(HINSTANCE)hModule,0);
ShowWindow(GetForegroundWindow(),SW_HIDE);
GetMessage(0,0,0,0);
}
programa que ejecuta el anterior y pide que se ingrese un texto
#include <stdio.h>
int main()
{
char cad[10];
system("C:\\bloqueaTecla.exe"); }