About Context menu from Janus Systems
Hi, when I right click some control(developed in dot Net), a pop up menu showed. Using Object Properties to browse the pop up menu, I found it was from Janus System company.
Please see the attached for the information. I can't click the item on the pop up menu, as what I did like Window.PopupMenu.Click("Copy"). I also record the right click action and the scripts showed like that Aliases.MyProcess.WinFormsObject("JNSCZ").Click(63 , 13). I don't want using coordinates. Can any body help me?
Re: About Context menu from Janus Systems
You need to use the ClickItem function outlined in the following script which works with Janus Northwind Demo:
<font class="small">Code:</font><hr /><pre>
Dim pSample, wMain, wPopupMenu, ItemStr
Set pSample = Sys.Process("Janus.NorthwindDemo")
Set wMain = pSample.MainForm
'Call the pop-up menu
Call wMain.WinFormsObject("TopRebar1").tbMainMenu.Click R
'Get the pop-up menu
Set wPopupMenu = pSample.WinFormsObject("JNSCZ", "")
ItemStr = "Standard"
If ClickItem(wPopupMenu, ItemStr) Then
Log.Message "The '" & ItemStr & "' menu item was successfully clicked."
Function ClickItem(wPopupMenu, ItemStr)
Dim ItemId, ItemCount, Item, YPos
ClickItem = False
ItemCount = wPopupMenu.Commands.Count
For ItemId = 0 To ItemCount - 1
Set Item = wPopupMenu.Commands.Item(ItemId)
If SameText(Item.Text, ItemStr) Then
'Perform a native click
Call Runner.CallObjectMethodAsync(Item, "InvokeOnClick")
Log.Event "The '" & ItemStr & "' menu item was left-clicked."
ClickItem = True
Log.Error "The '" & ItemStr & "' menu item was not found."