Mouse LCLICK

Started by mpiaser, November 02, 2013, 01:48:30 PM

Previous topic - Next topic

mpiaser

I am struggling with something that should be easy.  I have an application that has a File menu but no shortcut to the menu.  I move the mouse to File and left click and it works file and displayed Select and Exit options.  I move the mouse to the Select option and it highlights corrected.  Then I try to left click and it doesn't do it.  When I do this process manually, everything works.  When I run the following code, the Select option highlights(ie is selected) but the left click doesn't seem to do anything.
 
   MRI="MRI Software"
  Winactivate(MRI)
  timedelay(2)
  Winzoom(MRI)
  MouseMove(10,39,MRI,"") ;File Menu
  TimeDelay(2)
  MouseClick (@LCLICK,0)
    TimeDelay(2)
  MouseMove(10,70,MRI,"") ;File Select Option
    TimeDelay(10)    ;big delay so I can see that the select option is highlighted
  MouseClick (@LCLICK,0)    ; this is what doesn't seem to work.
  timedelay(2)
  exit

George Vagenas

If your dealing with a normal windows application check out "SendMenusTo" it should do the trick.
Thanks

George

mpiaser

SendMenusTo is a good idea, but I already tried it.  For some reason this application doesn't act like a normal windows application.  If I press ALT-F (not even in Winbatch), the File menu doesn't drop down.  But, if I mouse click it, it does. 

snowsnowsnow

It looks like the hard part (getting the menu itself to activate) is done.  That's good.

There should be some other way to select an option from the menu.  Is there a hot key (in the menu itself) for Select?

Or how using down arrow to move the focus, then SendKey'ing a ~ (enter) to do it?

mpiaser

When the SELECT option is highlighted, pressing enter does nothing.  Only a left mouse click causes it to execute.  The problem is that the left mouse click is working file when I put the cursor on FILE and I can move the mouse to SELECT and it correctly highlights.  But the left mouse click on SELECT doesn't work thru Winbatch but works when I do it manually.

snowsnowsnow

That's odd that Enter doesn't work.  I've never seen a menu that (fails to) work(s) like that.

mpiaser

This strange behavior seems related to running Winbatch on a Logmein session.

td

A guess but it may be that your remote session is not a console session so it is not attached to any physical keyboard or mouse device. If that is the case and there aren't any actual or emulated fully functional physical input device drivers associated with the Windows session, the 2 functions you mentioned are not going to work.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mpiaser

Reasonable guess but no magic on that.  There is a physical keyboard and mouse there.  The first left click I send via Winbatch works, then I move the mouse down a little and left click and that one is ignored.  I can tell the mouse is in the right place because the appropriate menu  item (SELECT) highlights.

It is weird that I can not see the remote system mouse pointer.

mpiaser

I think we've figured it out.  Looks like it is  a keyboard mapping option in LogMeIn.

td

Quote from: mpiaser on November 04, 2013, 08:08:52 AM
Reasonable guess but no magic on that.  There is a physical keyboard and mouse there.  The first left click I send via Winbatch works, then I move the mouse down a little and left click and that one is ignored.  I can tell the mouse is in the right place because the appropriate menu  item (SELECT) highlights.

It is weird that I can not see the remote system mouse pointer.

The presents of a physical keyboard and mouse means nothing as any given Windows session may or may not be attached to the physical input devices.  The WinBatch MouseMove function does not work by communicating directly with any device driver like MouseClick for single clicks does so that the mouse is in the right spot doesn't really say anything about the input devices or their drivers. 

That said, the fact that you can get a MouseClick to work once but the mouse cursor disappears does suggest something else is going on.   It could be a focus issue or perhaps even a buggy device driver.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade