Ver Mensaje Individual
  #4  
Antiguo 01-02-2006
Palmiro Palmiro is offline
Miembro
 
Registrado: oct 2005
Ubicación: Argentina - Chaco
Posts: 57
Reputación: 19
Palmiro Va por buen camino
hola he leido tu pregunta... he aqui te paso algunos procedimiento, puede que te siervan como ami....
-------------------------------------------------------------------
Código Delphi [-]
procedure TForm.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_NUMLOCK then
    case (GetKeyState(VK_NUMLOCK) + 127) of
      0: ShowMessage('Activo'); // Permite usar el teclado numérico
      -1: ShowMessage('Inactivo'); // Sólo funciona las teclas cursoras
    end;
end; 
 
if GetKeyState(VK_CAPITAL) = 1 then
  bEstado.Panels[8].Text := rsBloqMayus
else
  bEstado.Panels[8].Text := '';
  
if GetKeyState(VK_NUMLOCK) = 1 then
  bEstado.Panels[9].Text := rsBloqNum
else
  bEstado.Panels[9].Text := '';

if GetKeyState(VK_SCROLL) = 1 then
  bEstado.Panels[10].Text := rsScrolLock
else
  bEstado.Panels[10].Text := '';
  
procedure TMain.KeyState();
begin
  If GetKeyState(VK_NUMLOCK) = 1 Then
    StatusBar.Panels[2].Style:= psText
  else
    StatusBar.Panels[2].Style:= psOwnerDraw;

  If GetKeyState(VK_CAPITAL) = 1 Then
    StatusBar.Panels[3].Style:= psText
  else
    StatusBar.Panels[3].Style:= psOwnerDraw;

  If GetKeyState(VK_SCROLL) = 1 Then
    StatusBar.Panels[4].Style:= psText
  else
    StatusBar.Panels[4].Style:= psOwnerDraw;
end;
 
procedure TMain.KeyPressed(Key: DWORD);
begin
  If Key = VK_NUMLOCK then
    if (GetKeyState(VK_NUMLOCK) + 127) = 0 Then
      StatusBar.Panels[2].Style:= psText
    else
      StatusBar.Panels[2].Style:= psOwnerDraw;
      
  If Key = VK_CAPITAL then
    if (GetKeyState(VK_CAPITAL) + 127) = 0 Then
      StatusBar.Panels[3].Style:= psText
    else
      StatusBar.Panels[3].Style:= psOwnerDraw;
      
  If Key = VK_SCROLL then
    if (GetKeyState(VK_SCROLL) + 127) = 0 Then
      StatusBar.Panels[4].Style:= psText
    else
      StatusBar.Panels[4].Style:= psOwnerDraw;
end;
__________________
No es lo mejor, pero es lo que hay...

Última edición por jmariano fecha: 01-02-2006 a las 20:33:01. Razón: Uso de las etiquetas [delphi] y formateo del código
Responder Con Cita