|
Hi,
That 's right, all I want to do is sending some
window messages.
So now I try to implement a recording/replaying
mechanism in my Delphi program.
First, I should record the button click on any
lightweight ( thanks for the explanation!) component.
Then by replaying, it should be possible to click
the same component.
Kind regards, and thanks for the help,
Laurent.
----- Original Message -----
Sent: Wednesday, March 07, 2001 12:05
PM
Subject: RE: Windows
Maybe I'm misunderstanding, but I'm assuming Laurent wants to be able
to post WM_LMOUSE, or whatever windows message, to the JVM's windows message
queue, specifically addressing individual controls. AWT buttons, being
heavyweight components, will have their own windows handle, so you can
effectively click any button you can get the widows handle of. I'm not sure
about the details of a Swing frame, but I'd guess that the only thing that
will have a windows handle for sure will be the frame itself. You can't
post a message that will be intercepted by a JButton specifically, you'd have
to post a mouse-down event to the JFrame's windows handle at an x and y
within the bounds of the JButton. And how will you find those bounds
out?
I'm
sure Laurent has a very good reason for wanting to do this, but I would
suggest finding another cleaner solution. It just reminds me of how happy I am
to not have to program with the Windows API any more.
-----Original Message----- From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Steve Barrett Sent:
07 March 2001 07:52 To: Tim Gordon; [EMAIL PROTECTED] Subject:
RE: Windows
I don't understand the problem. Swing frames and windows are
AWT subclasses, so at least these should be as visible as their AWT
counterparts.
Tim Gordon <[EMAIL PROTECTED]> wrote:
Swing components are only drawings (lightweight
components). This is done for many reasons, efficiency and pluggable
look and feel being some.
The best way I know of to get at Java from Win32
is to use J-Integra (see http://www.linar.com/) to expose
Java classes as COM objects, although this will not give you access to the
Windows Message API, it'll just provide a path from Win32 (Delphi) to Java
code. Delphi has excellent COM support, so this may be of some
use.
If you're dead set on hacking the interaction
between Win32 and Java using Windows message then you'll only be able to
do it using AWT components, since they are heavyweight (ie real Win32
components). I wouldn't recommend this - you stand a good chance of
getting unexpected behaviour and maybe even crashing the JVM. The
J-Integra route would be a much cleaner solution, although admittedly a
bit more work.
Hi,
I am wondering if the swing components
contains any window.
I mean, if I run a tool like Spy++ or
WinSight32 to get all active window handlers,
it seems that it only detects my AWT
components. Not the swing ones.
From a Delphi application, I can send
Window Messages to my AWT components,
because I can get the window
handler.
Are the Swing components only
drawings?
Can I send Window Messages by any mean to
them??
Kind regards,
Laurent.
Do You Yahoo!? Yahoo! Mail
Personal Address - Get email at your own domain with Yahoo!
Mail.
|