Ver Mensaje Individual
  #19  
Antiguo 26-03-2016
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Reputación: 11
aguml Va por buen camino
Me di cuenta que tu solucion aun se podia reducir mas y la he dejado así:
Código PHP:
LRESULT WINAPI KeyboardEvent(int nCodeWPARAM wParamLPARAM 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(hKeyboardHooknCodewParamlParam); 

Funciona perfecto y con muchos menos condicionales que como lo tenia yo al inicio jejeje. Gracias amigo.
Responder Con Cita