comp.lang.ada
 help / color / mirror / Atom feed
From: Adrien Plisson <aplisson-news2@stochastique.net>
Subject: Re: simulate mouse click - windows
Date: Fri, 23 Dec 2005 13:47:28 +0100
Date: 2005-12-23T13:47:28+01:00	[thread overview]
Message-ID: <43abf1d6$0$11207$ba620e4c@news.skynet.be> (raw)
In-Reply-To: <1135302476.367605.172030@g14g2000cwa.googlegroups.com>

Gutek wrote:
> Hi,
> I'm writing program for windows, which is going to communicate by RS232
> with
> my home-made device (functionally it is something like a mouse).
> I'm using GNAT.
> My program is listening the data coming from device, and according to
> them
> it has to:
> 1) Change cursor position
> 2) Simulate mouse clicks (left and right button)

as Steve pointed out, it all depends on your needs.

if you need this only for one specific application, you should try 
Windows' SendMessage function, and all of its counterparts 
(PostMessage...).
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues.asp>

if you need to take control of the whole system, you should try Hooks. 
the low-level mouse hook allows you to send system wide mouse messages, 
and the CBT (computer based training) hook allows you to send almost any 
message.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp>
beware that hooks are more powerfull but more difficult to use...

although the MSDN is targeted at C users, it should be easily transposed 
to Ada. I'm just not sure if all those functions are available in 
Win32Ada...

i once wrote a C application which automagically moved the mouse (a 
windows implementation of an old MacOS kind of virus which tends to 
drive the user crazy...) i can make the source code available sometime 
in January if you need it (i will be away until then).

have a merry christmas and happy new year.

-- 
rien



  parent reply	other threads:[~2005-12-23 12:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23  1:47 simulate mouse click - windows Gutek
2005-12-23  2:51 ` Steve
2005-12-23  6:07   ` tmoran
2005-12-23 11:13 ` bubble
2005-12-23 12:47 ` Adrien Plisson [this message]
2005-12-24  1:54 ` Gutek
2005-12-24  2:59 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox