Searching \ for '[OT]: Simulating Mouse Clicks in XP (VC++)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/language/index.htm?key=c%2B%2B
Search entire site for: 'Simulating Mouse Clicks in XP (VC++)'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: Simulating Mouse Clicks in XP (VC++)'
2003\04\19@172259 by Konstantin Klitenik

picon face
I have a built a pointing device that interfaces to my computer through the
parallel port.  I have a simple program running and polling the port and
then determining which way to move the mouse pointer via SetCursorPos(x,y).

I also have two buttons that are supposed to be left and right mouse
buttons.  What I need is a way to send a mouse click message via a simple
console app.  The way it should work is when someone click the button, it
changes the state of the input pin on the parallel port which is polled by
my console app.  The change is detected and a mouse click command is issued
just like if it was a normal mouse click.

I have tried using SendMessage() but it doesn't seem to work right.  I might
be getting something wrong.  Can someone help me out with that and possibly
provide an example.  I'm working in Visual C++ 6.0 under WinXP.  Any help is
appreciated.

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\04\19@194105 by James Williams

picon face
Use PostMessage instead.

-----Original Message-----
From: pic microcontroller discussion list
[spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU] On Behalf Of Konstantin Klitenik
Sent: Saturday, April 19, 2003 5:22 PM
To: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject: [OT]: Simulating Mouse Clicks in XP (VC++)

I have a built a pointing device that interfaces to my computer through
the
parallel port.  I have a simple program running and polling the port and
then determining which way to move the mouse pointer via
SetCursorPos(x,y).

I also have two buttons that are supposed to be left and right mouse
buttons.  What I need is a way to send a mouse click message via a
simple
console app.  The way it should work is when someone click the button,
it
changes the state of the input pin on the parallel port which is polled
by
my console app.  The change is detected and a mouse click command is
issued
just like if it was a normal mouse click.

I have tried using SendMessage() but it doesn't seem to work right.  I
might
be getting something wrong.  Can someone help me out with that and
possibly
provide an example.  I'm working in Visual C++ 6.0 under WinXP.  Any
help is
appreciated.

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\04\22@211948 by Eric Bohlman

picon face
4/19/03 4:22:04 PM, Konstantin Klitenik <kostyan5spamKILLspamHOTMAIL.COM> wrote:

>I have a built a pointing device that interfaces to my computer through the
>parallel port.  I have a simple program running and polling the port and
>then determining which way to move the mouse pointer via SetCursorPos(x,y).
>
>I also have two buttons that are supposed to be left and right mouse
>buttons.  What I need is a way to send a mouse click message via a simple
>console app.  The way it should work is when someone click the button, it
>changes the state of the input pin on the parallel port which is polled by
>my console app.  The change is detected and a mouse click command is issued
>just like if it was a normal mouse click.
>
>I have tried using SendMessage() but it doesn't seem to work right.  I might
>be getting something wrong.  Can someone help me out with that and possibly
>provide an example.  I'm working in Visual C++ 6.0 under WinXP.  Any help is
>appreciated.

Look for MouseEvent (or is it mouse_event?), if it's supported under XP (it is under 98).  It's
intended for exactly what you want to do.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\04\22@230543 by Bob Ammerman

picon face
My MSDN documentation says:


mouse_event
The mouse_event function synthesizes mouse motion and button clicks.

Windows NT/2000/XP: This function has been superseded. Use SendInput
instead.

VOID mouse_event(
 DWORD dwFlags,         // motion and click options
 DWORD dx,              // horizontal position or change
 DWORD dy,              // vertical position or change
 DWORD dwData,          // wheel movement
 ULONG_PTR dwExtraInfo  // application-defined information
);
Send input is documented as:

SendInput
The SendInput function synthesizes keystrokes, mouse motions, and button
clicks.

UINT SendInput(
 UINT nInputs,     // count of input events
 LPINPUT pInputs,  // array of input events
 int cbSize        // size of structure
);Parameters
 nInputs
 [in] Specifies the number of structures in the pInputs array.
 pInputs
 [in] Pointer to an array of INPUT structures. Each structure represents an
event to be inserted into the keyboard or mouse input stream.
 cbSize
 [in] Specifies the size, in bytes, of an INPUT structure. If cbSize is not
the size of an INPUT structure, the function will fail.



Bob Ammerman
RAm Systems

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...