• Advertisement
Sign in to follow this  

howto get Window ID using JAVA?[SOLVED]

This topic is 4710 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In C++ there is a function that is similar, if not identical, to GetWindowID(hwnd). It can be used to get another Windows ID; this includes windows that are children of other applications. Are there any classes that have such a member function in JAVA? Specifically what I want to accomplish is this. There is an application that can conflict with my application but only under cirtain circumstances. I want to be able to identify and control, or avoid, those circumstances. If I can obtain a handle to the window of this application and also its children so that I may obtain their titles, ID's, and demensions then I will be able to avoid the conflict. Any suggestions? Mardigin. [Edited by - Mardigin on June 2, 2005 12:51:04 PM]

Share this post


Link to post
Share on other sites
Advertisement
First: It's Java. It's a name, not an acronym.
Second: I can't say I see any way to do this from plain Java Code (nor a sensible explanation why something like that should be exposed). I'm pretty sure you can gain access to the window handle via JNI though.

Share this post


Link to post
Share on other sites
1. This won't be possible without some use of (platform specific) JNI calls.

2. This sounds like a nasty hack to work around something thats broken rather than fixing it properly. If its a problem with your app, fix it. If not then bitch at the author of the other app and write a warning to users of your app.

Share this post


Link to post
Share on other sites
Thanks OrangyTang and BitMaster.

You were both right about that JNI calls. I managed to put together a workable solution and you are both right about it being a less than ideal solution. However, the authors of the other application will not budge and I of course do not have access to the source code to make the change myself. For now this will do.

Thank you.

Mardigin.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement