Skip to main content
GameDev.net gamedev.net
🔒 Locked

SendInput Help Needed

Started by Arbaxas Jan 12, 2005 at 3:36 PM 1 replies 500+ views
Original Post
Arbaxas
Arbaxas
I'm trying to use SendInput here, but it doesn't do the selected mouse operation. Same thign when I try to make it click as well. It compile and everything just doesn't move the mouse. Any help appreciated.

#include <windows.h>

#include <winable.h>

int main()

{

tagINPUT *Input;

Input = new tagINPUT;

Input->type = INPUT_MOUSE;

Input->mi.dwExtraInfo = 0;

Input->mi.dy = 0;

Input->mi.dx = 100;

Input->mi.mouseData = 0;

Input->mi.time = 0;

Input->mi.dwFlags = MOUSEEVENTF_MOVE;

SendInput(1,Input,sizeof(Input));

}
[Edited by - Arbaxas on January 12, 2005 4:45:50 PM]
Colin Jeanne
Colin Jeanne
This works for me:

#define _WIN32_WINNT 0x0500#include <stdio.h>#include <stdlib.h>#include <windows.h>int main(int argc, char *argv[]){  INPUT in = {0};  in.mi.dx = 100;  in.mi.dy = 0;  in.mi.dwFlags = MOUSEEVENTF_MOVE;  in.type = INPUT_MOUSE;  SendInput(1, ∈, sizeof(INPUT));  system("PAUSE");	  return 0;}
Arbaxas
Arbaxas
Thanks man, I spent forever trying to get SendInput to work.

Couldn't get the right libraries and what not.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.