Hi im trying to make a program that sends a message to a text file or skype and such i only want 1 message so far i only get 1 million messages that keep going all over the .txt i also want it to press enter and enter once but im having bad luck with this any suggestions?
SendKeys::Send ("Message") ;
SendKeys::Send ("{ENTER}") ;
When you use SendKeys::Send ("Message") ; you are calling a function called Send() with the character array "Message". What is done inside the function is unknown to me without the code. We need that body if we want to help you.
It's probably in a SendKeys.h header. If you don't have the body of the Send() function, you'll need to refer to the documentation of the function which should be available on the same website that you got the header from.
Edit:
Another thing that you could look for is that the Send() function is not called inside a loop. Something like this:
1 2
for (int i =0; i < 1000000; i++)
SendKeys::Send ("Message");
would send the message one million times as you had mentioned.
Well im putting this on a timer
for (int i =0; i < 1000000; i++)
SendKeys::Send ("Message");
But i need this on a timer that goes in 5 second then send the message onto text
To do this from scratch, you need to do some multi-threading which is not a beginner subject. To help we need to know what platform (windows/linux) you are using and what compiler you are using (To see if you support C++11).
I like to use Qt's QTimer class which lets me create a clock and pass a callback function to it. The clock will call this function ever X milliseconds indefinitely or for a specified number of times. To use this class, you need to install the Qt SDK. http://qt-project.org/doc/qt-4.8/QTimer.html
I'm sure there are other classes available in other libraries that others can recommend.