This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Please give me some advice to let a global hook call an java instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Please give me some advice to let a global hook call an java instance" Watch "Please give me some advice to let a global hook call an java instance" New topic
Author

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

Yueyu Lin
Greenhorn

Joined: Oct 16, 2003
Posts: 7
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please give me some advice to let a global hook call an java instance
 
Similar Threads
Java Native Interface
Calling a generic DLL
what is JNI and what are the advantages of JNI?
JNI crashes calling into C methods with structs
JNI in solaris (urgent)