I want to make a very simple program, that moves the mouse in one position, clicks etc etc
I have found some instructions but only under Visual C++.
How can this be done with MinGW?
thanx
I want to make a very simple program, that moves the mouse in one position, clicks etc etc
I have found some instructions but only under Visual C++.
How can this be done with MinGW?
thanx
I don't understand what would be different with MingW. Do you have a specific problem with the examples you've found?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Well, I tried this, found as an example. Didn't work. Do I need to include something else also?
Code:#include <windows.h> #include <iostream> using namespace System; using namespace System::Drawing; using namespace System::Windows::Forms; namespace CustomCursor { public __gc class Form1 : public System::Windows::Forms::Form { public: Form1() { this->ClientSize = System::Drawing::Size(292, 266); this->Text = S"Cursor Example"; this->Cursor = new System::Windows::Forms::Cursor(GetType(), S"MyCursor.Cur"); } }; } [STAThread] int main() { Application::Run(new CustomCursor::Form1()); }
That looks like managed C++, which is, of course, not going to compile in a traditional C++ compiler.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
So you are saying that I need a different approach for MinGW? Or should I get Visual Studio?
The code you posted is a "Windows Form" piece of code, and that is part of the "Managed code" system - it uses C++ language extensions that are not standard. Yes, you can compile it with Visual Studio if you wish, but the basic functionality for cursor management is there in the Windows API, so you don't need to use managed code to do that.
I have done custom cursors before (I wrote the cursor management in a driver, so I had to test all sorts of weird and wonderful versions of cursor code, which meant that I had to write my own little test app to switch to cursors that I knew what they would look like, and that "stretches the envelope", e.g. a 500+ pixel size cursor with alpha-blending so that it would be variably translucent against it's background).
The API functions that you can use for cursor manipulation are (I'm not convinced this is a complete list, but it's fairly comprehensive as far as I know - these are all links to the MSDN pages):
SetCursor
SetCursorPos
CreateCursor
LoadImage (There is a LoadCursor function, but LoadImage is a "better", more modern implementation that covers all sorts of image workings, including loading cursors).
ShowCursor
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.