|
-
May 24th, 2005, 01:31 PM
#1
Getting information of another window in java...
I was wondering if Java has the ability to get information from another window. I was using a program called AutoIt v3 Active Window Info, and it gets different information from a window such as the buttons and text fields in the window. I've included a couple of pictures to demonstrate it doing this.


Anyone have any ideas on how to do this in Java? Thanks
-
May 24th, 2005, 01:59 PM
#2
Re: Getting information of another window in java...
I don't believe its possible to do this unless you use JNI.
-
May 24th, 2005, 02:27 PM
#3
Re: Getting information of another window in java...
So I would have to use JNI and c++ or something?
-
May 25th, 2005, 03:28 PM
#4
Re: Getting information of another window in java...
You could certainly do it using JNI and C++ to the Windows SDK.
-
May 25th, 2005, 11:06 PM
#5
Re: Getting information of another window in java...
Isn't creating bots for the purpose of online gambling illegal?
"The Chicken and Rice MRE is not a personal lubricant."
-
May 26th, 2005, 12:10 AM
#6
Re: Getting information of another window in java...
This is the first time I've tried messing with JNI, so from what I read I tried through together some code. I first tested out the Hello world idea and that worked fine for me. Then II took my code that worked in C++ and tried to use it with JNI, and got some errors. Here's my code, followed by the errors...
Code:
POINT pt;
pt.x=200;
pt.y=570;
int nMaxCount = 10;
char buff[20];
HWND hWndParent;
hWndParent = WindowFromPoint(pt);
if(GetWindowText(hWndParent, buff, nMaxCount))
printf("%s",buff);
else
printf("null");
Code:
HelloWorld.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextA
@12
HelloWorld.obj : error LNK2001: unresolved external symbol __imp__WindowFromPoin
t@8
HelloWorldImp.dll : fatal error LNK1120: 2 unresolved externals
Is this just not supported in JNI or what? I'm totally lost here, so any help would be greatly appreciated. Thanks!
-
May 26th, 2005, 02:45 PM
#7
Re: Getting information of another window in java...
Does anyone have any experience with GetWindowText() and other functions of that sort with JNI?
-
May 27th, 2005, 04:40 AM
#8
Re: Getting information of another window in java...
Have you built a JNI DLL exporting the API functions you want to use?
Doing more things faster is no substitute for doing the right things...
S. R. Covey
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
May 27th, 2005, 05:05 PM
#9
Re: Getting information of another window in java...
That's when the compiler starts to whine at me...What's weird is when I try to compile the .cpp in Visual C++ it compiles fine, but when I try to compile in the command prompt using cl, it gives me those link errors
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|