procedure TForm1.Timer1Timer(Sender: TObject); var i: Integer; a: array[0..1] of TInput; begin for i := 0 to 1 do begin a[i].Itype := INPUT_KEYBOARD; a[i].ki.wVk := Ord('C'); // SCANCODE使用時は無視される a[i].ki.wScan := MapVirtualKey(Ord('C'), 0); a[i].ki.dwFlags := $08; //KEYEVENTF_SCANCODE if i = 1 then a[i].ki.dwFlags := $08 or $02; //KEYEVENTF_SCANCODE or KEYEVENTF_KEYUP a[i].ki.time := 0; a[i].ki.dwExtraInfo := GetMessageExtraInfo(); end; SendInput(2, a[0], SizeOf(a[0])); end;