NumLock on and off

procedure NumLockOn;
var KeyState:TKeyboardState;
begin
     GetKeyboardState(KeyState);
     KeyState[VK_NUMLOCK]:=$01;
     SetKeyboardState(KeyState);
end;

procedure NumLockOff;
var KeyState:TKeyboardState;
begin
     GetKeyboardState(KeyState);
     KeyState[VK_NUMLOCK]:=$00;
     SetKeyboardState(KeyState);
end;

//Replace VK_NUMLOCK with VK_CAPITAL or VK_SCROLL for CapsLock
//and ScrollLock

 

16 Aug 2001

Copyright 2001-2005 (C) ykwong.com All rights reserved.