Posted By: the_mehmaster
New, delete, and windows.h [RESOLVED *yes!*] - 12/12/10 00:08
Hey there,
The following code works and is compiling properly in VS 2010 -- But my problem is that I would like to get it working in lite-c...
I'm not really sure where to start though, as lite-c does not support or have a lot of what I am using.. I don't think lite-c has the 'new' or 'delete' operators (Which I am using inefficiently, but I need them none the less). Also, many of the structs are not defined in windows.h.. along with the the integral function 'SendInput'..
How would I go about this task? any help is greatly appreciated
Some links:
SendInput
A forum post (3rd last post on that page)
Thanks in advance...
The following code works and is compiling properly in VS 2010 -- But my problem is that I would like to get it working in lite-c...
I'm not really sure where to start though, as lite-c does not support or have a lot of what I am using.. I don't think lite-c has the 'new' or 'delete' operators (Which I am using inefficiently, but I need them none the less). Also, many of the structs are not defined in windows.h.. along with the the integral function 'SendInput'..
How would I go about this task? any help is greatly appreciated
Code:
#include <windows.h> void mouseMove(int dx, int dy) { INPUT* input = new INPUT; input->type = INPUT_MOUSE; input->mi.dx = dx; input->mi.dy = dy; input->mi.mouseData = 0; input->mi.dwFlags = MOUSEEVENTF_MOVE; input->mi.time = 0; input->mi.dwExtraInfo = 0; SendInput(1, input, sizeof(INPUT)); delete input; } int main(int argc, _TCHAR* argv[]) { while(1) { mouseMove(4,0); mouseMove(0,4); mouseMove(-4,0); mouseMove(0,-4); } return 0; }
Some links:
SendInput
A forum post (3rd last post on that page)
Thanks in advance...