Jump to content
Sign in to follow this  
vvb

Java UDF menu item bug

Recommended Posts

vvb

Hey all,

I've been playing with the Java UDF and am trying to perform menu selections. Howeverm the menu remains selected.

For example, I have a menu named Manage with two menu items, named Connect and Import.

Now, when I do the following, the menu remains visible.

;; connect
; manage menu
_JavaObjSelect("", "Manage", "menu")
; connect menu item
_JavaObjSelect("", "Connect", "menu item")

I had to do a

ControlSend($dlg, "", "{ESCAPE}")
to get rid of the menu. This is fine, but not desireable. However, when performing the following:

ControlSend($bde, "", "", "{ESCAPE}")

;; import
; manage menu
_JavaObjSelect("", "Manage", "menu")
; import menu item
_JavaObjSelect("", "Import...", "menu item")

This brings up a modal file selection dialogue (JFileChooser). The problem is that because the menu does not disappear , the AutoIt script remains in a wait state (line 600 of Java.au3) until I dismiss the file selection dialog and manually bring it up again. Line 600 of Java.au3 is the following:

$sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)

Is there a way around this?

Kind Regards,

Vlad


I'll be AutoIting my entire system soon.

Share this post


Link to post
Share on other sites
vvb

Sorry, totally missed it. Could an admin please move it to the general support section.

Thanks you.

BUMP! Can anyone give me some clues as to what I'm doing wrong?


I'll be AutoIting my entire system soon.

Share this post


Link to post
Share on other sites
Destabilizator

Did you try using _JavaObjDeselect() on the menu after you clicked on item in it? Since it actually doesn't move your mouse, it should work even "under" window which you get (I suppose, also you should attach to this window with _JavaAttachAndWait if you want to perform anything in it) after you click the item in menu.

Edited by Destabilizator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.