Как включить Caps Lock procedure TMyForm.Button1Click(Sender: TObject); Var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[VK_NUMLOCK] = 0) then KeyState[VK_NUMLOCK] := 1 else KeyState[VK_NUMLOCK] := 0; SetKeyboardState(KeyState); end; Для Caps Lock замените VK_NUMLOCK на VK_CAPITAL. Copyright © "DELPHI WORLD" E-mail: delphiworld@mail.ru http://www.delphiworld.narod.ru Источник получения информации: http://www.delphiworld.narod.ru
procedure TMyForm.Button1Click(Sender: TObject); Var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[VK_NUMLOCK] = 0) then KeyState[VK_NUMLOCK] := 1 else KeyState[VK_NUMLOCK] := 0; SetKeyboardState(KeyState); end;
Для Caps Lock замените VK_NUMLOCK на VK_CAPITAL.