FPCWindows.pas
上传用户:yj_qiu
上传日期:2022-08-08
资源大小:23636k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Delphi

  1. unit FPCWindows;
  2. interface
  3. const
  4.   user32    = 'user32.dll';
  5.   INPUT_MOUSE = 0;
  6.   INPUT_KEYBOARD = 1;
  7.   INPUT_HARDWARE = 2;
  8.   CSIDL_PROGRAMS                      = $0002;
  9.   CSIDL_PERSONAL                      = $0005;
  10.   CSIDL_STARTUP                       = $0007;
  11.   CSIDL_RECENT                        = $0008;
  12.   CSIDL_SENDTO                        = $0009;
  13.   CSIDL_BITBUCKET                     = $000a;
  14.   CSIDL_STARTMENU                     = $000b;
  15.   CSIDL_DESKTOPDIRECTORY              = $0010;
  16.   CSIDL_NETHOOD                       = $0013;
  17.   CSIDL_TEMPLATES                     = $0015;
  18.   CSIDL_APPDATA                       = $001a;
  19. type
  20.   UINT = LongWord;
  21.   PKeyboardState = ^TKeyboardState;
  22.   TKeyboardState = array[0..255] of Byte;
  23.   PMouseInput = ^TMouseInput;
  24.   tagMOUSEINPUT = packed record
  25.     dx: Longint;
  26.     dy: Longint;
  27.     mouseData: DWORD;
  28.     dwFlags: DWORD;
  29.     time: DWORD;
  30.     dwExtraInfo: DWORD;
  31.   end;
  32.   TMouseInput = tagMOUSEINPUT;
  33.   PKeybdInput = ^TKeybdInput;
  34.   tagKEYBDINPUT = packed record
  35.     wVk: WORD;
  36.     wScan: WORD;
  37.     dwFlags: DWORD;
  38.     time: DWORD;
  39.     dwExtraInfo: DWORD;
  40.   end;
  41.   TKeybdInput = tagKEYBDINPUT;
  42.   PHardwareInput = ^THardwareInput;
  43.   tagHARDWAREINPUT = packed record
  44.     uMsg: DWORD;
  45.     wParamL: WORD;
  46.     wParamH: WORD;
  47.   end;
  48.   THardwareInput = tagHARDWAREINPUT;
  49.   PInput = ^TInput;
  50.   tagINPUT = packed record
  51.     Itype: DWORD;
  52.     case Integer of
  53.       0: (mi: TMouseInput);
  54.       1: (ki: TKeybdInput);
  55.       2: (hi: THardwareInput);
  56.   end;
  57.   TInput = tagINPUT;
  58.   _RTL_CRITICAL_SECTION = TRTLCRITICALSECTION;
  59.   function SendInput(cInputs: UINT; var pInputs: TInput; cbSize: Integer): UINT; stdcall;
  60. implementation
  61.   function SendInput(cInputs: UINT; var pInputs: TInput; cbSize: Integer): UINT; stdcall external user32 name 'SendInput';
  62. end.