java调用 windows api,是否有Java库来访问本机Windows API?

Is there a Java library to access the native Windows API? Either with COM or JNI.

解决方案

You could try these two, I have seen success with both.

The Java/Win32 integration project

(Jawin) is a free, open source

architecture for interoperation

between Java and components exposed

through Microsoft's Component Object

Model (COM) or through Win32 Dynamic

Link Libraries (DLLs).

JNA provides Java programs easy access

to native shared libraries (DLLs on

Windows) without writing anything but

Java code—no JNI or native code is

required. This functionality is

comparable to Windows' Platform/Invoke

and Python's ctypes. Access is dynamic

at runtime without code generation.

JNA allows you to call directly into

native functions using natural Java

method invocation. The Java call looks

just like it does in native code. Most

calls require no special handling or

configuration; no boilerplate or

generated code is required.

Also read up here:

The Java Native Interface (JNI) is a

programming framework that allows Java

code running in a Java Virtual Machine

(JVM) to call and to be called1 by

native applications (programs specific

to a hardware and operating system

platform) and libraries written in

other languages, such as C, C++ and

assembly.

Java Native Access provides Java

programs easy access to native shared

libraries without using the Java

Native Interface. JNA's design aims to

provide native access in a natural way

with a minimum of effort. No

boilerplate or generated glue code is

required.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值