Hey, I was just wondering what was the simplest way to "real" world type, like open wordpad and you could watch it actually typing, thanks in advance. (Hopefully the answer is not writing to file etc)

Wha'?

Do you meen actually emulating keypresses ?
Here is an example of how to do that:

#include<iostream>
#include<windows.h>
using namespace std;

void SendKeysWait(char *text, int interval);

int main() {
	system("start C:\\Windows\\notepad.exe");
	Sleep(1000);
	SendKeysWait("Hello world!", 30);
	cin.ignore();
	return 0;
}

void SendKeysWait(char *text, int interval) {
	int ch;
	int ch2 = -1;
	bool SHIFTDOWN = 0;
	for (int i = 0;  text[i]; i++) {
		SHIFTDOWN= 0;
		switch (text[i]) {
			case '\"':{ch = VkKeyScan('\"');ch2= VK_SHIFT; SHIFTDOWN = 1;} break;
			case '£': {ch = VkKeyScan('£');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '$': {ch = VkKeyScan('$');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '%': {ch = VkKeyScan('%');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '^': {ch = VkKeyScan('^');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '&': {ch = VkKeyScan('&');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '*': {ch = VkKeyScan('*');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '_': {ch = VkKeyScan('_');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '+': {ch = VkKeyScan('+');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '{': {ch = VkKeyScan('{');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '}': {ch = VkKeyScan('}');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '@': {ch = VkKeyScan('@');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '~': {ch = VkKeyScan('~');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '?': {ch = VkKeyScan('?');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '<': {ch = VkKeyScan('<');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '>': {ch = VkKeyScan('>');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '|': {ch = VkKeyScan('|');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case ':': {ch = VkKeyScan(':');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '!': {ch = VkKeyScan('!');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case '(': {ch = VkKeyScan('(');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			case ')': {ch = VkKeyScan(')');ch2 = VK_SHIFT; SHIFTDOWN = 1;} break;
			default:
				{
					if (text[i] >= 'A' && text[i] <= 'Z') {
						ch = VkKeyScan( text[i]);
						ch2 = VK_SHIFT;
						SHIFTDOWN = 1;
					} else ch = VkKeyScan( text[i]);
				}
		}
		if (SHIFTDOWN) keybd_event(ch2, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
		keybd_event(ch, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);
		keybd_event(ch, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
		if (SHIFTDOWN) keybd_event(ch2, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
		Sleep(interval);
	}
}

I just made this work with my computer, dont know about others :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.