开发者

How can I listen to Windows events from a Java app?

开发者 https://www.devze.com 2022-12-10 04:37 出处:网络
I have a process written in C++ that raises a named event using CreateEvent. Is there a java implementation of the WaitForSingleObject function?

I have a process written in C++ that raises a named event using CreateEvent. Is there a java implementation of the WaitForSingleObject function?

Is there a better way to pass events between a C++开发者_如何学Python or .NET process and a Java process?

(I am aware of the option to use JNI to wrap whatever calls I want. I am looking for a library that already took care of it.)

thanks,

Ariel


Technolgies which might be useful:

  • Java Native Access (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.

  • Message oriented Middleware which includes C/C++ drivers, for example Apache ActiveMQ, OpenMQ or xmlBlaster


There is no such API in the standard Java API, because that's a highly platform-specific Windows thing (and Java is platform-independent, so you won't find such Windows-only functionality in Java's standard API).

You could write some code in C++ and call it from your Java program using JNI.

0

精彩评论

暂无评论...
验证码 换一张
取 消