Kamikaze_Badger Posted May 12, 2005 Posted May 12, 2005 How can I make an error/alert window in C/++? I'm making a little prank for my friend to use on his parents("WARNING: Error of type: ID-10-T has occured. Please call HP Tech Support immediately!"), whom aren't very smart when it comes to computers. And, I think the guys at TS need a laugh . Google hasn't turned up much... where art god of coding, Markie? Share this post Link to post Share on other sites More sharing options...
cybergrunt69 Posted May 12, 2005 Posted May 12, 2005 How about using VBScript or Javascript? Using windows messenger can also work too... Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted May 12, 2005 Posted May 12, 2005 I don't like to learn ev... easier languages that have less power. Not as fun... Share this post Link to post Share on other sites More sharing options...
gunak87 Posted May 12, 2005 Posted May 12, 2005 Just stick a post-it note to the screen. They sound stupid enough to fall for it. Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted May 12, 2005 Posted May 12, 2005 They're not that stupid. His mother knows Algebra. Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted May 13, 2005 Posted May 13, 2005 MessageBox() is probably suitable for what you need. http://msdn.microsoft.com/library/default..../messagebox.asp If you're unable to understand that, something along the lines of: MessageBox(NULL, "Message Text Here", "Window Title Here", MB_OK | MB_ICONWARNING); Should work.. EDIT: Google hasn't turned up much... where art god of coding, Markie? just noticed that. I had an "Algorithms and Datastructures" exam yesterday, so I kinda didn't look at the forums much. Got home and played games for the remaineder of my day Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted May 15, 2005 Posted May 15, 2005 Ok, tried that and it worked using only windows.h for an include . However, a DOS window also pops up... any idea on how to get rid of that? #include <windows.h> bool i = false; int main() { while(i == false) { MessageBox(NULL, "WARNING! Error of type ID-10-T\nhas occured! Contact HP tech support ASAP!\n", "ERROR", MB_OK | MB_ICONWARNING); } return 0; } Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted May 15, 2005 Posted May 15, 2005 In old pal Dev-C++ if you go to... Project -> Project Options -> Compiler -> Linker There should be an option there called... "Do not create console window". Try sticking that to "Yes". Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted May 15, 2005 Posted May 15, 2005 Yay! Thank you, oh God of coding, the boo of markies! If anybody wants to try it out... EDIT: Ack, included the wrong bit of source code... who cares, run it anyway. Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted May 15, 2005 Posted May 15, 2005 Yay! Thank you, oh God of coding, the boo of markies! 477802[/snapback] quite alright old chap, a.k.a you're welcome. By the way, that executable is quite large. Have you got debugging stuff turned on or something?? Share this post Link to post Share on other sites More sharing options...
Kamikaze_Badger Posted May 15, 2005 Posted May 15, 2005 No... I blame windows.h. Share this post Link to post Share on other sites More sharing options...
markiemrboo Posted May 15, 2005 Posted May 15, 2005 No... I blame windows.h. 477810[/snapback] Nice idea, but... sadly isn't windows.h Nothing but MessageBox() and windows.h here is 14k. I reckon you may have debugging turned on somewhere! Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now