[RESOLVED] I'm able to move the mouse pointer and right click but left click doesn't work
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: [RESOLVED] I'm able to move the mouse pointer and right click but left click doesn't work

Threaded View

  1. #1
    Join Date
    Nov 2009
    Posts
    18

    [RESOLVED] I'm able to move the mouse pointer and right click but left click doesn't work

    Code:
    #define _WIN32_WINNT 0x0501
    #include <windows.h>
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
    
    INPUT *mouse;
    
    mouse = new INPUT;
    mouse->type = INPUT_MOUSE;
    mouse->mi.dx = 65535;
    mouse->mi.dy = 65535;
    mouse->mi.mouseData = 0;
    mouse->mi.dwFlags = MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE;
    mouse->mi.time = 0;
    mouse->mi.dwExtraInfo = 0;
    SendInput(1,mouse,sizeof(INPUT));
    
    mouse->mi.dx = 0;
    mouse->mi.dy = 0;
    mouse->mi.dwFlags = MOUSEEVENTF_RIGHTDOWN|MOUSEEVENTF_RIGHTUP;
    SendInput(1,mouse,sizeof(INPUT));
    
    return 0;
    }
    I do not know why right click works but not left click.

    EDIT: I use autohide so I clicked before the taskbar popped up. Problem resolved.
    Last edited by gregorian; December 6th, 2009 at 04:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center