From: Quintus <su...@gm...> - 2010-02-24 14:30:37
|
Hi there, First off, I'm quite new to the C world, but I try to learn what I can get... So, here's my problem: I've a small C program that simulates some mouse input to Windows and if I run this from the MSYS shell it works quite well. Now, if I try to run it from CMD or by double-clicking on the executable file, nothing happens. I searched the web for that problem, but couldn't find any reasonable help, so now I'm posting here... That's a small sample program: ---------------------------------------- #define _WIN32_WINNT 0x0500 #include <windows.h> int main(int argc, char *argv[]) { INPUT inps[2]; MOUSEINPUT mis[2]; inps[0].type = INPUT_MOUSE; inps[1].type = INPUT_MOUSE; mis[0].mouseData = 0; mis[0].dwFlags = MOUSEEVENTF_LEFTDOWN; mis[1].mouseData = 0; mis[1].dwFlags = MOUSEEVENTF_LEFTUP; inps[0].mi = mis[0]; inps[1].mi = mis[1]; SendInput(2, inps, sizeof(INPUT)); return 0; } ---------------------------------------- I'm running on Windows Vista and didn't pass any compilation options to gcc, I just did "gcc abc.c" and than ran "a.exe". Can anyone explain this to me? Quintus |