Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Please give me some advice to let a global hook call an java instance  RSS feed

Yueyu Lin
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I succeeded in using JNI to build a global hook in win32.(Just combine the hook functions and jni functions into one dll).
But what I want to do is when the hooking procedure is called,the procedure can notify the java instance that called the jni functions so that the java program can do some thing additional.
I found that I cannot hold the pointor to the jobject and jnienv,I can just get a global reference of jclass,but it's useless!
I had no idea about that the hook procedure to call the java instance's method.
Can you do me a favor to let me know that how I can notify my java instance?Of course,I can let java application to listen a local port,and the hook procedure can send messages to the listened port using winsock.But I think it's the worst way to do this task.I hope there are some other ways to do this job directly and efficiently.
THKs all.Merry X'mas!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!