I have spent hours trying to get SendInput (with MOUSEINPUT)working...
Can anyone provide me with a working example please???

btw I am using MASM

Thank you very much. :wink:
Posted on 2004-09-03 04:23:01 by goggles99
Would you please give me a situation where this might be usefull? I am not quite shure if this will be a good approach for 99% of the times. Why simulate and input? It's like an app talking to itself--- going mad.

I'll try and then attempt doing it- but at the moment i see no real use for it.

Black iCE (And i know you'll hate me for this post, others might have uses for it...).
Posted on 2004-09-03 04:56:16 by Black iCE
I think what you mean is the API function mouve_event (similar to keybd_event)...


usage:
VOID mouse_event(
DWORD dwFlags,
DWORD dx,
DWORD dy,
DWORD dwData,
ULONG_PTR dwExtraInfo
);



invoke mouse_event, MOUSEEVENTF_LEFTDOWN, 100d, 100d, 0h, 0h
invoke mouse_event, MOUSEEVENTF_LEFTUP, 100d, 100d, 0h, 0h


Simulating keyboard / mouse inputs isn't used quite often although i take it instead of coding script for some stupid task...

Dom
Posted on 2004-09-03 06:55:23 by Dom
Would you please give me a situation where this might be usefull? I am not quite shure if this will be a good approach for 99% of the times. Why simulate and input? It's like an app talking to itself--- going mad.

I'll try and then attempt doing it- but at the moment i see no real use for it.

Black iCE (And i know you'll hate me for this post, others might have uses for it...).


I am using this for low level mouse movment to send to a Direct3d game. I need low level because SetCursorPos isn't low level enough for the game to use. I would use Mouse_Event, But according to msdn Documentation, mouse_event has been superseded by SendInput. 8)

Thanks
Posted on 2004-09-03 12:52:39 by goggles99
Take a look what the local Genius had to say about superceeded API's:
http://www.win32asmcommunity.net/phpBB2/viewtopic.php?p=149112#149112

So i guess i am trying to say that if you get it working on the mouse_event then why bother using SendInput? I had a couple of cases where the depreciated API worked on first try and the other 1 just took me forever... eventually ammounting to the same. :lol:

Black iCE
Posted on 2004-09-05 04:27:20 by Black iCE
Take a look what the local Genius had to say about superceeded API's:
http://www.win32asmcommunity.net/phpBB2/viewtopic.php?p=149112#149112

So i guess i am trying to say that if you get it working on the mouse_event then why bother using SendInput? I had a couple of cases where the depreciated API worked on first try and the other 1 just took me forever... eventually ammounting to the same. :lol:

Black iCE

LOOK....
I asked for help with a function...not for programming advice.

I need to insert several mouse events into the event queue, and they must be executed in order.

SendInput() locks out the physical input device, and any events from them will only be recognized when your stuffing is complete mouse_Event does not.

SendInput lets you send a stream of input events, and guarantees that they'll all make it to the input queue as a cohesive group Mouse_Event Doesn't do that OK. The functions are different... They do DIFFERENT things.

If I use mouse event in a loop, user mouse events can be placed into the mouse queue between my events. This is not the case with SendInput....

Besides... SendInput handles things in a much more efficient way when sending multiple events... (only has to be called once)

If you can't help me with what I ASKED for... Please don't reply here. 8)
Posted on 2004-09-06 03:49:54 by goggles99
Ok, i have also googled around and as i can see there are cases where the ppl consirnd using sendinput eventually used mouse_event. In any case the INPUT struct is one of TYPE UNION that eko is dealing with in another thread on this board. As i said i am keeping an eye on that thread, and as far as i understand with that thread the union must be taken as it's largest possible size ----

In any case if you feel, you may post some of your coded attempts up so others may look. They might be able to point out a simple mistake!


goggles99

I have spent hours trying to get SendInput (with MOUSEINPUT)working...
Can anyone provide me with a working example please???

btw I am using MASM


That's like sayin' "It doesn't work, why?". I'll be damned if i can guess that from sitting here without a look? Have you eva considered how call centers work? Could you give some more clues? Like errors, or some code that others might be able to shed some light. Remember nearly everyone here are busy with their own projects and they can afford to give some debug, code post to help their own progress along. Look @ some other posts on this board and see what i am talking about.

So, have you some attempts to show? What did you do with the UNION struct? There could be little coding mistakes.

link to one topic from codeguru forum:
http://www.codeguru.com/forum/showthread.php?threadid=258694
Posted on 2004-09-06 06:07:36 by Black iCE
Thanks...

I thought that someone might just have a asm snippet lying around...
If not, Just let this thread sink to the bottom :(

I don't want to put anyone out...
Posted on 2004-09-06 07:16:37 by goggles99