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]
#350291
12/15/10 09:00
12/15/10 09:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Dude! What does this demo do when you run it, and what are you running it with? Im using A7.86.0 Comm and the mouse performs the little squares, but it also wanders off to the top-left of the screen... Did it do that for you?!? [EDIT] PS: I will be getting to your PM later tonite... [EDIT 2] For what it is worth, here is a savagely cut down version of meh_masters code.... windows.h no longer requires, ans structs over-simplified... (still has the drift problem on my machine...)
#include <acknex.h>
#include <default.c>
long __stdcall SendInput(long cInputs,long pInputs,long cbSize);
API(SendInput,user32)
typedef struct MOUSEINPUT
{
long type; //unused : always ZERO for mouse
long dx, dy; //move mouse by dx, dy pixels
long unused_0; //unused
long dwFlags; //static : always 0x1 for mouse-input
long unused_1[2]; //unused
} MOUSEINPUT;
void mouseMove(int dx, int dy)
{
static MOUSEINPUT* input = NULL;
if(!input) { input = sys_malloc(sizeof(MOUSEINPUT));
memset(input, 0, sizeof(MOUSEINPUT));
input.dwFlags = 0x1; }
//-----------------------------------------------------
input.dx = dx;
input.dy = dy;
SendInput(0x1, input, sizeof(MOUSEINPUT));
}
void main()
{
level_load("");
while(1)
{
mouseMove(40,0);
wait(1);
mouseMove(0,40);
wait(1);
mouseMove(-40,0);
wait(1);
mouseMove(0,-40);
wait(1);
}
}
Last edited by EvilSOB; 12/15/10 09:35. Reason: code added
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
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
|
|
|