3 registered members (AndrewAMD, VoroneTZ, 1 invisible),
1,176
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: New, delete, and windows.h
[Re: the_mehmaster]
#350282
12/15/10 04:38
12/15/10 04:38
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
OP
User
|
OP
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
GREAT SCOTT I think I have it!! Program now does what I want it to .. Yay!! For anyone else who wants to achieve a similar feat: First you must go into acknex's windows.h, and uncomment 'long WINAPI SendInput(long cInputs,long pInputs,long cbSize);' Also, 'API(SendInput,user32)' needs to be added there, and then this code will work:
#include <acknex.h>
#include <default.c>
#include <windows.h>
typedef unsigned long ULONG_PTR;
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT;
#define INPUT_MOUSE 0
typedef struct tagINPUT {
DWORD type;
MOUSEINPUT mi;
} INPUT;
void mouseMove(int dx, int dy)
{
INPUT* input = sys_malloc(sizeof(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));
sys_free(input);
}
void main()
{
level_load("");
while(1)
{
mouseMove(4,0);
wait(1);
mouseMove(0,4);
wait(1);
mouseMove(-4,0);
wait(1);
mouseMove(0,-4);
wait(1);
}
}
Yes!!! Thanks Richi007 for the help !!
|
|
|
Entire Thread
|
New, delete, and windows.h [RESOLVED *yes!*]
|
the_mehmaster
|
12/12/10 00:08
|
Re: New, delete, and windows.h
|
MasterQ32
|
12/12/10 00:12
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/12/10 00:20
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/12/10 07:18
|
Re: New, delete, and windows.h
|
MasterQ32
|
12/14/10 15:42
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 03:32
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 04:20
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 04:24
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 04:38
|
Re: New, delete, and windows.h
|
gri
|
12/15/10 06:40
|
Re: New, delete, and windows.h
|
EvilSOB
|
12/15/10 09:00
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 10:22
|
Re: New, delete, and windows.h
|
EvilSOB
|
12/15/10 11:20
|
Re: New, delete, and windows.h
|
WretchedSid
|
12/15/10 12:20
|
Re: New, delete, and windows.h
|
the_mehmaster
|
12/15/10 20:53
|
|
|