Me di cuenta que tu solucion aun se podia reducir mas y la he dejado así:
Código PHP:
LRESULT WINAPI KeyboardEvent(int nCode, WPARAM wParam, LPARAM lParam)
{
static count=0;
if(nCode == HC_ACTION && (wParam == WM_SYSKEYDOWN || wParam == WM_KEYDOWN)){
if(!GetAsyncKeyState(VK_CONTROL) && !GetAsyncKeyState(VK_SHIFT) && !GetAsyncKeyState(VK_MENU)){
if(*(PDWORD)lParam == (unsigned int)toupper(Form1->Edit1->Text[count+1]))
count++;
else
count = 0;
if(count == Form1->Edit1->Text.Length()){
count = 0;
Form1->ButtonQuitarHook->Click();
}
}
return -1;
}
return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
}
Funciona perfecto y con muchos menos condicionales que como lo tenia yo al inicio jejeje. Gracias amigo.