Help!! i need to use motion sensor to move the mouse cursor...but first i must use C++ to do out a programme that can move the mouse cursor first...i only left 2 week..can anyone please help me??
Using visual C++ to move mouse cursor(Urgently)!!
Started by bennoooo, Nov 30 2008 10:23 PM
3 replies to this topic
#1
Posted 30 November 2008 - 10:23 PM
|
|
|
#2
Posted 01 December 2008 - 01:18 AM
You wont find anyone that will do your homework for you. Especially when you haven't specified any specific problem, and probably have not even tried to do it by yourself. As soon as you post parts of code that you are having trouble with we can help you.
Interested in participating in community events?
Want to harness your programming skill and turn it into absolute prowess?
Come join our programming events!
#3
Posted 01 December 2008 - 06:50 PM
i have 1 of the programme here but there is a fatal error in it...it about the #include "stdafx.h" they cant find it in the directory at all, i have try changing some of the setting but it still cant find it. What it about??
#include "stdafx.h"
int main(int argc, char* argv[]){
INPUT *buffer = new INPUT[3]; //allocate a buffer
buffer->type = INPUT_MOUSE;
buffer->mi.dx = 100;
buffer->mi.dy = 100;
buffer->mi.mouseData = 0;
buffer->mi.dwFlags = (MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE);
buffer->mi.time = 0;
buffer->mi.dwExtraInfo = 0;
(buffer+1)->type = INPUT_MOUSE;
(buffer+1)->mi.dx = 100;
(buffer+1)->mi.dy = 100;
(buffer+1)->mi.mouseData = 0;
(buffer+1)->mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
(buffer+1)->mi.time = 0;
(buffer+1)->mi.dwExtraInfo = 0;
(buffer+2)->type = INPUT_MOUSE;
(buffer+2)->mi.dx = 100;
(buffer+2)->mi.dy = 100;
(buffer+2)->mi.mouseData = 0;
(buffer+2)->mi.dwFlags = MOUSEEVENTF_LEFTUP;
(buffer+2)->mi.time = 0;
(buffer+2)->mi.dwExtraInfo = 0;
SendInput(3,buffer,sizeof(INPUT));
delete (buffer); //clean up our messes.
return 0;
}
Edited by WingedPanther, 01 December 2008 - 07:06 PM.
add code tags (the # button)
#4
Posted 01 December 2008 - 07:07 PM
What directories are you including in your compiler's search path?


Sign In
Create Account

Back to top









