Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI help  RSS feed

 
Suman Mummaneni
Ranch Hand
Posts: 96
Android Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is it possible to send the HWND (handel for a window in VC++) for a Windows XP print dialog from Java using JNI.
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no platform-independent way of getting the HWND from Java.

I think the easiest way to do it would be to use some JNI code that uses Windows API to get the list of open windows on your machine, and iterate through the list to find your window. There are other solutions that involve going into the guts of your target JVM to pull out the HWND. Second solution is not recommended in most cases

Can you tell us more details of what you are trying to do?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!