I am writing a program, that will automatically post an image from a folder on my computer onto a blog of mine. I want to be able to have the program add a title for the post and maybe even fill in some tags. I don't know how to make a c++ program insert text anywhere. Any help would be great.
Not that it really matters will my question but here is the code so far.
(I am new, I know this is probably a crappy way to do this, but I am just trying to learn right now)
#include <windows.h>
#include <ctime>
int main()
{
ShellExecute(NULL, "open", "http://somesiteofmine.org/somethingelse",
NULL, NULL, SW_SHOWNORMAL);
Sleep(4000); // wait for 2000 ms.
const int media = 1; // click for 1 second
const int media_X = 381; // x-coordinate of mouse
const int media_Y = 370; // y-coordinate of mouse
SetCursorPos(media_X,media_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
Sleep(2000); // wait for 2000 ms.
const int select = 1; // click for 1 second
const int select_X = 413; // x-coordinate of mouse
const int select_Y = 337; // y-coordinate of mouse
SetCursorPos(select_X,select_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
Sleep(1000); // wait for 1000 ms.
const int document = 1; // click for 1 second
const int document_X = 152; // x-coordinate of mouse
const int document_Y = 100; // y-coordinate of mouse
SetCursorPos(document_X,document_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
const int folder = 1; // click for 1 second
const int folder_X = 137; // x-coordinate of mouse
const int folder_Y = 100; // y-coordinate of mouse
SetCursorPos(folder_X,folder_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
const int picture = 1; // click for 1 second
const int picture_X = 137; // x-coordinate of mouse
const int picture_Y = 100; // y-coordinate of mouse
SetCursorPos(folder_X,folder_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
Sleep(5000); // wait for 5000 ms.
const int scrolldown = 1; // click for 1 second
const int scrolldown_X = 831; // x-coordinate of mouse
const int scrolldown_Y = 636; // y-coordinate of mouse
SetCursorPos(scrolldown_X,scrolldown_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
//This is where adding text will go when I figure it out...............
const int center = 1; // click for 1 second
const int center_X = 556; // x-coordinate of mouse
const int center_Y = 549; // y-coordinate of mouse
SetCursorPos(center_X,center_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
const int insert = 1; // click for 1 second
const int insert_X = 403; // x-coordinate of mouse
const int insert_Y = 624; // y-coordinate of mouse
SetCursorPos(insert_X,insert_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
//This is where it will add the title when I figure it out
Sleep(4000);
const int post = 1; // click for 1 second
const int post_X = 927; // x-coordinate of mouse
const int post_Y = 450; // y-coordinate of mouse
SetCursorPos(post_X,post_Y);
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
return 0;
}