Thread: msg box prob

  1. #1
    Unregistered
    Guest

    msg box prob

    Hi, i want to create a little program that says it will delete your system files and stuff (not for real ofcourse) Now i want to put in a message box but when i did that it returned a lot of error's. Heres the code:
    MessageBox (NULL, "0wned. Druk ff op OK als je wilt dat ik wat **** van je PC verwijder zoals command.com autoexe.bat sys.ini etc." , "fux0r 0wned your b0x", 0 + MB_ICONEXCLAMATION + MB_SETFOREGROUND);
    hehe dont mind the language. I use Bloodshev 4.1
    I think i just dont know the right library files and needed commands. So could anyone post a little piece of code where one message is given. Thx

  2. #2
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    replace your +'s with |'s (Shift+\)

    MessageBox (NULL, "Text." , "Title", 0 | MB_ICONEXCLAMATION);

    i've never heard of MB_SETFOREGROUND. and i don't think it is a valid MessageBox type so i omitted it.
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  3. #3
    Unregistered
    Guest
    Damn
    I copied your code into the compiler, but then i got these faults.

    5 c:\windows\desktop\blaat.c
    `MB_ICONEXCLAMATION' undeclared (first use in this function)

    5 c:\windows\desktop\blaat.c
    (Each undeclared identifier is reported only once

    5 c:\windows\desktop\blaat.c
    for each function it appears in.)

  4. #4
    Unregistered
    Guest
    Here is the whole code:

    #include <stdio.h>

    main()
    {
    MessageBox (NULL, "blaat" , "fux0r owned j00", 0 | MB_ICONEXCLAMATION);
    system("PAUSE");
    return 0;
    }

  5. #5
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    include windows.h
    Code:
    #include <stdio.h>
    #include <windows.h>
    
    main()
    {
    	MessageBox (NULL, "blaat" , "fux0r owned j00", 0 | 
    		MB_ICONEXCLAMATION);
    	system("PAUSE");
    return 0;
    }
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  6. #6
    Unregistered
    Guest
    Hey thnx it worked
    Now could you also give me the command (and the needed header or commands) to let the systeem reboot.
    After that I will stop asking you questions, I promise

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Go to the windows board.

    Quzah.
    Hope is the first step on the road to disappointment.

  8. #8
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    Originally posted by quzah
    Go to the windows board.
    you're right this is more Window's specific. but since we already started...

    look into ExitWindowsEx() to restart.
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    46
    Ok.... Ihell or high water I will learn microsoft visual c++
    but when I compile this code in their I get this....

    --------------------Configuration: Message Box - Win32 Debug--------------------
    Compiling...
    Message Box.cpp
    c:\program files\microsoft visual studio\myprojects\message box\message box.cpp(11) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.


    WTF does that mean?

  10. #10
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    >> system("PAUSE"); <<

    You don't need to pause the system. Execution halts until you click "OK" on the msgbox.

    --Garfield
    1978 Silver Anniversary Corvette

  11. #11
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    Originally posted by Intimd8r
    --------------------Configuration: Message Box - Win32 Debug--------------------
    Compiling...
    Message Box.cpp
    c:\program files\microsoft visual studio\myprojects\message box\message box.cpp(11) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.
    this might work but i'm not sure:

    go to the end of you code (the final '}') and press 'Enter'. so there's an extra line at the the bottom of your cpp file. and recompile. let me know if it works or not.
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  12. #12
    Registered User
    Join Date
    Sep 2001
    Posts
    46
    No it didn't work... in Bloodshed it compiled without a problem but for won't in visual c++ 6.

  13. #13

    Post msg BOX

    It would be easier to just to use something like VB script

  14. #14
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Bite your tongue. Don't say that. There might be children reading this
    1978 Silver Anniversary Corvette

  15. #15
    Unregistered
    Guest
    Originally posted by WayTooHigh


    you're right this is more Window's specific. but since we already started...

    look into ExitWindowsEx() to restart.
    hmm, i tried to but when i do this: #include <stdio.h>
    #include <windows.h>

    main()
    {
    ExitWindowsEx();
    system("PAUSE");
    return 0;
    }


    I get this fault:



    6 c:\windows\desktop\untitl~1.c
    too few arguments to function `ExitWindowsEx'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  3. API Text box prob
    By GuardianBarak in forum C++ Programming
    Replies: 8
    Last Post: 09-12-2004, 05:16 PM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM