1

I'm embarking on a project where I need to use the java.awt.Robot class to interact with a program on the Windows OS.

Is there I can query the system for say, a running instance of "notepad" and have it return me the window dimensions? I'm just using "notepad" as an example. I can't discuss the actual program I'm trying to interact with.

I hope the question isn't too vague. If task manager is able to keep a running list of what is happening, then shouldn't I be able to also find my specific program?

Edit: Based on the answer I have received so far, I have examined the calling win32 api method from java that has been suggested. But I am still vague on how to get the win32 to solve my problem. That thread is asking on how to use dll's.

My problem, as far as I know, is just getting a running instance of "notepad" and then using the win32 api's GetWindowRect method to return me a dimension that I can then use with Robot to tell me where to go. Unfortunately I have no idea on how to do this, I am still fairly new when it comes to Java. Any help would be appreciated.

Community
  • 1
  • 1
Samuel
  • 574
  • 3
  • 7
  • 22

1 Answers1

1

It depends on what you are trying to do.

If you want to get window dimensions, you should recognize that win32 api can provide that information.

And, if win32 api is providing that information, how do you call win32 api functions from java? is the question you should be asking.

Community
  • 1
  • 1
Prasanth
  • 5,230
  • 2
  • 29
  • 61
  • Thanks for the direction, I'm still very new with Java so I have yet to understand all of its capabilities. – Samuel Nov 01 '12 at 10:33