help making a message box popup

This is a discussion on help making a message box popup within the Windows Programming forums, part of the Platform Specific Boards category; i am learning c++ and am working on an application that popups a messagebox when somebody presses ok or cancel ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    44

    help making a message box popup

    i am learning c++ and am working on an application that popups a messagebox when somebody presses ok or cancel
    Code:
    MessageBox(NULL,"God you idiot i told you not to open it","You idiot",MB_OKCANCEL);
    do i need to add a
    Code:
    function::OnOK();
    function::OnCANCEL();
    because i think that is how the API does it?

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Lightbulb I believe you need this ...

    Okay. It's been a while since I've posted here. I have been really busy in high school, and I have a project I'm working on. I'm working on a 2D engine, using SDL, for a game my friends and I are going to make.

    Anyhow, here's what I believe you need:

    Code:
    int nRet = MessageBox(NULL, "Message", "Title", MB_OKCANCEL);
    
    if (nRet == MB_OK) 
    {
        // Process "Ok" button
        // ...
    }
    else if (nRet == MB_CANCEL) 
    {
        // Process "Cancel" button
        // ...
    }
    If you're wanting to know what the user chooses, that's they answer.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating an Edit Box (Subclassing)
    By csonx_p in forum Windows Programming
    Replies: 9
    Last Post: 05-05-2008, 06:36 AM
  2. Making a script language?
    By Blackroot in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 01:22 AM
  3. Message box / Structure question?
    By dxfoo in forum Windows Programming
    Replies: 5
    Last Post: 10-24-2005, 01:43 PM
  4. edit box affecting displaying of text?
    By algi in forum Windows Programming
    Replies: 4
    Last Post: 05-04-2005, 03:28 PM
  5. moving a dialog box and making a button a bitmap
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 05-22-2002, 04:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21