Ik heb al wat afgezocht bij Google enzo en de search op dit forum heb ook al doorlopen, maar ik kom niet tegen wat ik zoek. Iemand een idee?
Verwijderd
Ik heb geen tijd om een voorbeeld te geven, maar zoek is op de win api 'keybd_event'; hiermee kun je het indrukken van een toets simuleren.
Eerste hit met google:
http://www.torry.net/keysandkeyboard.htm
Scroll daar ff wat naar beneden en zie daar:
En hiero de link naar de source.KeyLed v.1.0 FWS 4 Kb 31.10.01
By Winsoft Ltd. Delphi component for retrieving and setting keyboard CapsLock, NumLock and ScrollLock status.
Fully functional
Source: Included
Niet wat je bedoelt?
"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney
Daar wordt deze code gebruikt:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| procedure SetKeyState(Key: Integer; TurnOn: Boolean);
var Buffer: TKeyboardState;
begin
case Win32Platform of
VER_PLATFORM_WIN32_WINDOWS: // Win95/98/ME
begin
GetKeyboardState(Buffer);
Buffer[Key] := Ord(TurnOn);
SetKeyboardState(Buffer)
end;
VER_PLATFORM_WIN32_NT: // WinNT/2000
begin
if GetKeyState(Key) <> TurnOn then
begin
keybd_event(Key, $45, KEYEVENTF_EXTENDEDKEY, 0); // simulate key press
keybd_event(Key, $45, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); // simulate key release
end;
end
end;
end; |
"The shell stopped unexpectedly and Explorer.exe was restarted."
Geen probleem, graag gedaan.
"The shell stopped unexpectedly and Explorer.exe was restarted."
Met wat voor commando moet ik dit nou aansturen?
Pagina: 1