-1

我有一个使用来自 dinput.dll(直接输入)的 API 的程序,我已经对其进行了监控,结果是这样的:

API 名称:DirectInputCreateEx 模块名称:C:\Windows\system32\DINPUT.dll

关于另一个使用直接输入的程序:

API 名称:DirectInputCreateA 模块名称:C:\Windows\system32\DINPUT.dll

此 API 将更新此注册表项:

HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProperties\DirectInput

我想知道如何使用 Delphi 编写只为 DirectInput dll 调用此 API 的代码?

非常感谢任何帮助...

4

1 回答 1

1

为了调用直接输入,您需要对头文件进行 Delphi 翻译。据我所知,最好的此类翻译可从Clootie 图形页面获得。

您需要使用DirectInput.pas标题翻译。

至于写一个不显示窗口的程序,这里是最简单的模板:

program MyProgram;
begin
  //write your program's code here
end.

您在评论中声明您希望调用的唯一函数是DirectInputCreateEx. 要调用该函数,您需要以下导入声明:

function DirectInputCreateEx(hinst: THandle; dwVersion: DWORD; 
  const riidltf: TGUID; out ppvOut; punkOuter: IUnknown): HResult; 
  stdcall; external 'dinput.dll';
于 2012-01-11T15:52:21.530 回答