==================================================
procedure SetCapsLockKey( vcode: Integer; down: Boolean );
begin
if Odd(GetAsyncKeyState( vcode )) <> down then
begin
keybd_event( vcode, MapVirtualkey( vcode, 0 ),
KEYEVENTF_EXTENDEDKEY, 0);
keybd_event( vcode, MapVirtualkey( vcode, 0 ),
KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);
end;
end;
===================================================
在BUTTOM1之Click事件中加入以下:
SetcapsLockKey( VK_CAPITAL, True );
如此按下按鈕就可設定CAPS LOCK啟動或是關閉
轉貼至 http://delphi.ktop.com.tw/board.php?cid=16&fid=43&tid=355
沒有留言:
張貼留言