I've seen numerous examples on how to use the older
Mouse_Event() function, but this doesn't seem to work
(crashes) in Windows XP.
--
Report Bugs: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
<Ronnie Po> wrote in message news:4a170c2c.2a3...@sybase.com...
For what it's worth, my implementation of Mouse_Event(),
which crashes with a "Bad runtime function" message in
Windows XP, looks like this:
/* Declare Global External Functions. */
FUNCTION boolean SetCursorPos(int cx, int cy) LIBRARY
"User32.dll"
SUBROUTINE Mouse_Event(ulong dwflag,ulong dx,ulong dy,ulong
cbutton,ulong dwextra) LIBRARY "User32.dll"
//dwflag: 1 = do nothing, 7 = L-button clicked, 25 =
R-button clicked
/* Position cursor and simulate mouse click */
integer li_x, li_y
/* After successfully setting li_x and li_y to the desired
pixel coordinates: */
SetCursorPos(li_x, li_y) // This part works
Mouse_Event(7, 0, 0, 0, 0) // "Bad runtime function
reference..."
Why not just use the built-in PB SEND method?
For example ... LHMB on an SLE within a window:
Send(Handle(wm_mywin), 273, 0, Handle(sle_1))
hth
--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com
<Ronnie Po> wrote in message news:4a170c2c.2a3...@sybase.com...
--
Report Bugs: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
<Ronnie Po> wrote in message news:4a1a3a5a.1bb...@sybase.com...
Thanks for pointing that out, Jerry.
> I'm looking at
> http://msdn.microsoft.com/en-us/library/ms646260.aspx and
> it shows the function name as mouse_event with lower
> case. That may be why it is not found, see the first
> gotcha on http://www.sybase.com/detail?id=44648
>
> --
> Report Bugs: http://case-express.sybase.com/cx/welcome.do
> Product Enhancement Requests:
> http://my.isug.com/cgi-bin/1/c/submit_enhancement
>
> <Ronnie Po> wrote in message
> > news:4a1a3a5a.1bb...@sybase.com... That msdn
> > topic is what inspired me to issue a call for help here.
> > As a non-VB programmer, I wasn't quite sure how to
> > translate the parameter types when declaring the global
> external function for SendInput(). >
> > For what it's worth, my implementation of Mouse_Event(),
> > which crashes with a "Bad runtime function" message in
> > Windows XP, looks like this:
> >
> > /* Declare Global External Functions. */
> > FUNCTION boolean SetCursorPos(int cx, int cy) LIBRARY
> > "User32.dll"
> >
> > SUBROUTINE Mouse_Event(ulong dwflag,ulong dx,ulong dy
> > ,ulong cbutton,ulong dwextra) LIBRARY "User32.dll"