Thread: mouse_event problem

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    20

    mouse_event problem

    I'm trying to emulate mouse input on an application using DirectX to draw the graphics and the API I have chosen is mouse_event (please don't tell me about SendInput unless it has a direct relation to my issue, I know it superseded by it) and this only seems to move the mouse. (in the incorrect position, I might add) I believe my syntax usage is correct & I've checked with MSDN to be sure but no avail Does anyone know what my issue is? If so, any help would be appreciated.

    Code:
    mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);
    Thanks in advance.

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    This does belong in the Games or Windows section... And idealy you should be using SendInput, Microsoft has dropped support for this function.

    I wouldn't be using mouse_event, although it appears you are using it correctly maybe your problem lies before / after this segment of code?
    Last edited by zacs7; 05-01-2007 at 06:29 AM.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    20
    Forgive me for my ill placement of this topic, I'm not decisive enough :P

    Thank you once again for your support zacs7, this is the third time! I'll try the code under another environment to see if this is due to my code (possible logical errors) and I'll report my results.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM