[Help]Get Some Ideas

Posts 1–6 of 6 · Page 1 of 1
[Help]Get Some Ideas
Hey guys,

I wrote this code to annoy a friend (haven't finished it yet ), and am wondering what else I could do with it. I would like to make it so you can't close it out very easily. What would I need to do to make that happen? My c++ skills are so bad, I spent forEVER trying to disable the X button...Anyway, any ideas as to what could be done to make it REALLY hard to close out?? Here's the code...
Code:
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
using namespace std;

main()
{
    int i,d,q;

    EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
    DrawMenuBar(GetConsoleWindow());
    
      cout<<"Please enter the letter 'q' and press 'enter'\n";
      cin>>d;
      loop:1;
      for(i=0; i<=1; i++)
      {
               if(d='q')
               cout<<"HAHAHAHA!!!\n";

             }

    goto loop;

    system("pause");

	return 0;
}
Thanks,
Add this

[php]CloseButtonModifier(MODIFY_GRAYED);[/php]
[php]
if(d='q')
[/php]

Should be

[php]
if(d == 'q')
[/php]
dont use system("pause"), its really not good.
use cin.get() instead.
Code:
#include <winable.h>
Put this inside the loop:
Code:
BlockInput(true);
In win7/vista I know you can just ctr alt delete out if it, but in XP if it's in a loop the only way to stop it is to shut down your PC or wait until the loop ends (if it ends).
Ok, thanks!

Thanks again to everyone! I know this is sloppy but here's what I came up with.
Code:
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <winable.h>
using namespace std;

main() {

    int d,i;

    EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
    DrawMenuBar(GetConsoleWindow());

    cout<<"Please add a letter and press 'enter'\n";
    cin>>d;

    loop:1;

      for(i=0; i<=1; i++)
      {
               d='c';
               cout<<"HAHAHAHA!!!\n";
               BlockInput(true);
      }
      goto loop;

	return 0;
}
Thanks again!
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?