bonjour,
je cherche la méthode pour allumer une des trois leds ( Num_Lock, Caps_Lock et Scroll_Lock) du clavier.
merci d'avance pour les conseils
++
bonjour,
je cherche la méthode pour allumer une des trois leds ( Num_Lock, Caps_Lock et Scroll_Lock) du clavier.
merci d'avance pour les conseils
++
Exemple pour le NumLock:
Marche sous D6PE Win2k
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 procedure TForm1.Button1Click(Sender: TObject); var KeyInputs: array of TInput; KeyInputCount: Integer; procedure KeybdInput(VKey: Byte; Flags: DWORD); begin Inc(KeyInputCount); SetLength(KeyInputs, KeyInputCount); KeyInputs[KeyInputCount - 1].Itype := INPUT_KEYBOARD; with KeyInputs[KeyInputCount - 1].ki do begin wVk := VKey; wScan := MapVirtualKey(wVk, 0); dwFlags := KEYEVENTF_EXTENDEDKEY; dwFlags := Flags or dwFlags; time := 0; dwExtraInfo := 0; end; end; begin KeyInputCount:=0; KeybdInput(VK_NUMLOCK, 0); KeybdInput(VK_NUMLOCK, KEYEVENTF_KEYUP); SendInput(KeyInputCount, KeyInputs[0], SizeOf(KeyInputs[0])); end;
Partager