Hello again, I've been messing around, which is my preferred way of learning. For my first program I'm making a small practical joke to play on some friends. I'm almost done, but could do with a little hand, so any help would be greatly appreciated.
What the program does is pretend to steal some form of account details, even though it blatantly doesn't. As a said, it's just a little joke.
I've made 2 programs that both work, and wanted to combine them into one program, but that's where I'm having difficulty. Here are the two programs:
Code:
#include <windows.h>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
cout<<"Obtaining information";
Sleep(400);
cout<<".";
Sleep(400);
cout<<".";
Sleep(400);
cout<<".";
Sleep(800);
cout<<"\nCreating pass_dump.txt";
Sleep(400);
ofstream a_file ("pass_dump.txt");
a_file<<"Relax! You really think I'd /*edited out*/ my friends over?";
a_file.close();
cout<<"\npass_dump.txt has been created.\nAttempting to send";
Sleep(400);
cout<<".";
Sleep(400);
cout<<".";
Sleep(400);
cout<<".";
Sleep(2000);
cout<<"\npass_dump.txt successfully sent to /*edited out*/@hotmail.com";
}
Code:
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MessageBox(0, "Never trust a dodgy .exe! You just got pwned, fool.", "\"eddwills pwnz u\"", 0);
return 0;
}
(Excuse the leet speak.)
I took the messagebox from the tutorials, which have been pretty darn good to me so far, but I'm having troubles getting them both to run as one program. I just want the messagebox to appear after the stuff in cmd.
Also, is there a way to state where a file is created? I'd quite like that "pass_dump.txt" to be on the user's desktop, but it's not too important.
Thanks again, Edd.