• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Info about Opened Windows In Xp  RSS feed

 
Chandru Sekar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a application that can minimize any open windows to System Tray. For that, i know how to use SystemTray in Java. But, does anybody know how to get the information about the opened window in XP.

For, Example,
If i opended MyComputer And MyVideos, i should get information that The opened windows are MyComputer and MyVideos. So that i can minimize those windows to SystemTray,(ie creating Shortcut in SystemTray. )

So, If anybody knows how to get the opended windows in Xp, reply.......
 
Piet Verdriet
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chandru Sekar:
...
So, If anybody knows how to get the opended windows in Xp, reply.......


You can't do this "purely" in Java.
Java is simply not designed to interact directly with the OS. In order to accomplish what you describe, you will need to write a fair amount of native code and bridge that to your Java application using JNI (Google for "JNI tutorial" to find out more about it).
Not a trivial task, and it will be platform dependent!
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piet is right, you will have to resort to JNI.

Hint: the EnumWindows function can help you enumerate over all windows. Keep in mind that this includes non-visible windows. Other useful functions are IsWindowVisible, GetWindowText and GetWindowRect.

Check out these functions on MSDN and you should get quite far (that is, if you can get a grip on JNI and C(++)).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!