Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   polling for popup created by 3rd party java app (http://www.velocityreviews.com/forums/t131065-polling-for-popup-created-by-3rd-party-java-app.html)

2xzero 02-05-2004 04:19 PM

polling for popup created by 3rd party java app
 
Hello everyone,

I've searched sun.java's website and haven't found any info on if this
can be done. Perhaps someone here has done the same type of project.

Basically I want to listen for a popup message from this other
application which I don't have the source code to and automate a 'yes'
button press to it.

So far the solution seems to need to use jni and then C++ dll to poll
the windows event que, do a time diff,etc.....(yuk) However, I see
that C# can do this very easily, perhaps I could integrate C# with
java and be less work than the jni method.

I'm cluching straw here...can anyone share there experience with other
possible solutions to this type of problem.

Much thanks in advance. Joe

zn˘rt 02-16-2004 11:58 AM

Re: polling for popup created by 3rd party java app
 
On 5 Feb 2004 08:19:05 -0800, jobo.enteract@rcn.com (2xzero) wrote:

>Hello everyone,
>
>I've searched sun.java's website and haven't found any info on if this
>can be done. Perhaps someone here has done the same type of project.


Windows' event queue is not Java related, so no wonder you didn't find
anything there.

>Basically I want to listen for a popup message from this other
>application which I don't have the source code to and automate a 'yes'
>button press to it.
>
>So far the solution seems to need to use jni and then C++ dll to poll
>the windows event que, do a time diff,etc.....(yuk)


That's the most flexible and obvious aproach.

On the other hand, instead of polling the mesage queue, I would
suggest traversing the window list (using win32 EnumWindows API) at
regular intervals until your popup is found or you decide to timeout.

>However, I see
>that C# can do this very easily, perhaps I could integrate C# with
>java and be less work than the jni method.


I don't know how you would code this in C#, but doing it in c++ is
pretty trivial. And then, with JNI you have a nice, clean and standard
interface from Java to c++, an extra problem by itself you had to
solve if you were to code it in C#.

>
>I'm cluching straw here...can anyone share there experience with other
> possible solutions to this type of problem.


Check out Java/COM bridge solutions, which allow you to access COM
objects from Java. Neva Object's Java2Com works great. Or you could
have your native popup-catcher be a standalone app in whatever
language, start it with Runtime.exec() and let your Java app get rid
of that nasty stuff alltogether.

Last of all, since you seem willing to stick with such platfrom
dependant hassles, you could try out MS's VM (i.e., VisualJ++). It has
custom native interfaces that might suit you, and is pretty OO (that
means, Obscene and Obsolete). :-)
>
>Much thanks in advance. Joe


regards
zn˘rt




All times are GMT. The time now is 04:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.