WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mpiaser on November 02, 2013, 01:48:30 PM

Title: Mouse LCLICK
Post by: mpiaser on November 02, 2013, 01:48:30 PM
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
Title: Re: Mouse LCLICK
Post by: George Vagenas on November 02, 2013, 03:52:06 PM
If your dealing with a normal windows application check out "SendMenusTo" it should do the trick.
Title: Re: Mouse LCLICK
Post by: mpiaser on November 03, 2013, 08:13:30 AM
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. 
Title: Re: Mouse LCLICK
Post by: snowsnowsnow on November 03, 2013, 09:08:14 AM
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?
Title: Re: Mouse LCLICK
Post by: mpiaser on November 03, 2013, 02:49:08 PM
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.
Title: Re: Mouse LCLICK
Post by: snowsnowsnow on November 03, 2013, 10:15:43 PM
That's odd that Enter doesn't work.  I've never seen a menu that (fails to) work(s) like that.
Title: Re: Mouse LCLICK
Post by: mpiaser on November 04, 2013, 04:57:18 AM
This strange behavior seems related to running Winbatch on a Logmein session.
Title: Re: Mouse LCLICK
Post by: td on November 04, 2013, 07:24:50 AM
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.
Title: Re: Mouse LCLICK
Post by: 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.
Title: Re: Mouse LCLICK
Post by: mpiaser on November 04, 2013, 08:25:45 AM
I think we've figured it out.  Looks like it is  a keyboard mapping option in LogMeIn.
Title: Re: Mouse LCLICK
Post by: td on November 04, 2013, 09:03:56 AM
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.