From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,501f57fc0d7fea05 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!news.astraweb.com!newsrouter-eu.astraweb.com!feeder2.news-service.com!skynet.be!newspost001!tjb!not-for-mail Date: Fri, 23 Dec 2005 13:47:28 +0100 From: Adrien Plisson Reply-To: aplisson-news2@stochastique.net User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: simulate mouse click - windows References: <1135302476.367605.172030@g14g2000cwa.googlegroups.com> In-Reply-To: <1135302476.367605.172030@g14g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <43abf1d6$0$11207$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: 467803d7.news.skynet.be X-Trace: 1135342038 news.skynet.be 11207 80.200.101.168:10037 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:6985 Date: 2005-12-23T13:47:28+01:00 List-Id: 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...). 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. 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