PLEASE need help making dialog box for simple game

I just need to know what i will need essentially to make a dialog box show on my game, just the basics "hello world" kinda stuff. p.s. I cant use the wizard.

if any one can help or even just give me a couple examples I would be very grateful,

p.s. Does anyone else hate deadlines??

Comments

  • : I just need to know what i will need essentially to make a dialog box show on my game, just the basics "hello world" kinda stuff. p.s. I cant use the wizard.
    :
    : if any one can help or even just give me a couple examples I would be very grateful,
    :
    : p.s. Does anyone else hate deadlines??
    :
    Do you want this dialog box in Windows (i.e. using Win32 API) ?
  • : : I just need to know what i will need essentially to make a dialog box show on my game, just the basics "hello world" kinda stuff. p.s. I cant use the wizard.
    : :
    : : if any one can help or even just give me a couple examples I would be very grateful,
    : :
    : : p.s. Does anyone else hate deadlines??
    : :
    : Do you want this dialog box in Windows (i.e. using Win32 API) ?
    :
    yes its a win32 application It keeps telling me it cant find the


  • You can use the MessageBox() function from Win 32 API:

    int MessageBox(hwnd Hwnd, char far * message, char far * title, uint flags);

    where:
    Hwnd - handle of the window for which you want to create the dialog box,
    message - text of the message
    title - dialog title
    flags - combination of the following constants:
    MB_OK - dialog has the OK button
    MB_YESNO - dialog has YES and NO buttons
    MB_ABORTRETRYIGNORE - dialog has ABORT, RETRY and IGNORE buttons
    MB_ICONQUESTION - dialog has a question mark icon
    MB_ICONINFORMATION - dialog has "i" icon
    MB_ICONSTOP - dialog has "!" icon
    It's not all but it should do. Here's a simple example:

    MessageBox(MyWindowHwnd, "This is my dialog box", "Dialog box",
    MB_OK | MB_ICONINFORMATION);

    This will create a dialog box with a string "This is my dialog box", that has the OK button and an "i" icon. MessageBox() returns value indicating what button was used to close it (i.e. MB_OK, MB_YES, MB_CANCEL etc.).

    As to your second question (about iomanip and strstrea) try using:
    #include
    #include

    I some compilers it matters whether you put .h in the name of the include file. If it doesn't work, check your "include" paths in your compiler's settings.

  • : You can use the MessageBox() function from Win 32 API:
    :
    : int MessageBox(hwnd Hwnd, char far * message, char far * title, uint flags);
    :
    : where:
    : Hwnd - handle of the window for which you want to create the dialog box,
    : message - text of the message
    : title - dialog title
    : flags - combination of the following constants:
    : MB_OK - dialog has the OK button
    : MB_YESNO - dialog has YES and NO buttons
    : MB_ABORTRETRYIGNORE - dialog has ABORT, RETRY and IGNORE buttons
    : MB_ICONQUESTION - dialog has a question mark icon
    : MB_ICONINFORMATION - dialog has "i" icon
    : MB_ICONSTOP - dialog has "!" icon
    : It's not all but it should do. Here's a simple example:
    :
    : MessageBox(MyWindowHwnd, "This is my dialog box", "Dialog box",
    : MB_OK | MB_ICONINFORMATION);
    :
    : This will create a dialog box with a string "This is my dialog box", that has the OK button and an "i" icon. MessageBox() returns value indicating what button was used to close it (i.e. MB_OK, MB_YES, MB_CANCEL etc.).
    :
    : As to your second question (about iomanip and strstrea) try using:
    : #include
    : #include
    :
    : I some compilers it matters whether you put .h in the name of the include file. If it doesn't work, check your "include" paths in your compiler's settings.
    :
    : Good looking out Im on my way to go try it
    Thanks

  • Sorry, I've given you incorrect constants for return values of MessageBox. They are as follows:

    IDABORT Abort button was selected.
    IDCANCEL Cancel button was selected.
    IDIGNORE Ignore button was selected.
    IDNO No button was selected.
    IDOK OK button was selected.
    IDRETRY Retry button was selected.
    IDYES Yes button was selected.


  • : I just need to know what i will need essentially to make a dialog box show on my game, just the basics "hello world" kinda stuff. p.s. I cant use the wizard.
    :
    : if any one can help or even just give me a couple examples I would be very grateful,
    :
    : p.s. Does anyone else hate deadlines??
    :

    here is a pretty good tutorial about how to write Windows programs using Win32 API functions. You will need this if you want to do anything more than a simple MessageBox() as others said.

    http://www.winprog.org/tutorial/

  • ya forgot to add that the strings need to be null terminated, eg instead of
    MessageBox(Handle,"Something","Title",MB_OK);
    you would do:
    MessageBox(Handle,"Something/0","Title/0",MB_OK);
    if ya dont ya'll get a nasty looking access violation runtime error(note that it will compile properly, cuz the compiler doesn't check if it's ASCII or ASCIIZ(Z reperesents Zero)

    [hr]
    Best Regards,
    Mateusz Jadczak, Leading C++ Programmer of Multitool Team

  • [b][red]This message was edited by MT2002 at 2007-2-10 18:15:40[/red][/b][hr]
    : ya forgot to add that the strings need to be null terminated, eg instead of
    : MessageBox(Handle,"Something","Title",MB_OK);
    : you would do:
    : MessageBox(Handle,"Something/0","Title/0",MB_OK);
    : if ya dont ya'll get a nasty looking access violation runtime error(note that it will compile properly, cuz the compiler doesn't check if it's ASCII or ASCIIZ(Z reperesents Zero)
    :
    : [hr]
    : Best Regards,
    : Mateusz Jadczak, Leading C++ Programmer of Multitool Team
    :
    [blue]
    Never happened to me (In Borland Builder 5, MSVC++ 6 nor MSVC++ Express)

    Only thing to take note of, MessageBox() (along with alot of other
    Win32 routines) is a macro (Not a routine) that call the approparaite
    Message box routines (In case Unicode is defined).

    If you want to be safe, you can use the TEXT() macro to specify text.
    [/blue]
  • : ya forgot to add that the strings need to be null terminated, eg instead of
    : MessageBox(Handle,"Something","Title",MB_OK);
    : you would do:
    : MessageBox(Handle,"Something/0","Title/0",MB_OK);
    : if ya dont ya'll get a nasty looking access violation runtime error(note that it will compile properly, cuz the compiler doesn't check if it's ASCII or ASCIIZ(Z reperesents Zero)
    :
    : [hr]
    : Best Regards,
    : Mateusz Jadczak, Leading C++ Programmer of Multitool Team
    :
    :
    [blue]Mateusz,

    You have a bad compiler - no offence.
    Good compiler will produce the symbol at every declared string, so simple "Hi" will be terminated automatically.[/blue]
  • : : ya forgot to add that the strings need to be null terminated, eg instead of
    : : MessageBox(Handle,"Something","Title",MB_OK);
    : : you would do:
    : : MessageBox(Handle,"Something/0","Title/0",MB_OK);
    : : if ya dont ya'll get a nasty looking access violation runtime error(note that it will compile properly, cuz the compiler doesn't check if it's ASCII or ASCIIZ(Z reperesents Zero)
    : :
    : : [hr]
    : : Best Regards,
    : : Mateusz Jadczak, Leading C++ Programmer of Multitool Team
    : :
    : :
    : [blue]Mateusz,
    :
    : You have a bad compiler - no offence.
    : Good compiler will produce the symbol at every declared string, so simple "Hi" will be terminated automatically.[/blue]
    :

    Ok, I just have to say, look at the date, this was posted THREE YEARS AGO!!!
  • : : : ya forgot to add that the strings need to be null terminated, eg instead of
    : : : MessageBox(Handle,"Something","Title",MB_OK);
    : : : you would do:
    : : : MessageBox(Handle,"Something/0","Title/0",MB_OK);
    : : : if ya dont ya'll get a nasty looking access violation runtime error(note that it will compile properly, cuz the compiler doesn't check if it's ASCII or ASCIIZ(Z reperesents Zero)
    : : :
    : : : [hr]
    : : : Best Regards,
    : : : Mateusz Jadczak, Leading C++ Programmer of Multitool Team
    : : :
    : : :
    : : [blue]Mateusz,
    : :
    : : You have a bad compiler - no offence.
    : : Good compiler will produce the symbol at every declared string, so simple "Hi" will be terminated automatically.[/blue]
    : :
    :
    : Ok, I just have to say, look at the date, this was posted THREE YEARS AGO!!!
    :
    [blue]
    Arn't (According to thread searches) "Threads more then a year old" are supposed to be archived (and not accept any more replies to it)?

    You are correct though -- just a little curious.[/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories