Jump to content

c++

Registered User
  • Posts

    2
  • Joined

  • Last visited

Posts posted by c++

  1. First we start with a message box. This is going to be like the gui version of the C++ "Hello World" Program. I highly recommend buying sublime text to use and a mingw compilier.

    //api.cpp

    #include <Windows.h>

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

    LPSTR szCmdLine, int iCmdShow)

    {

    MessageBox(0,"Hello World","Hello World", MB_YESNOCANCEL | MB_ICONINFORMATION);

    }

    Now we add a reply function (a simple beep)

    #include <Windows.h>

    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

    LPSTR szCmdLine, int iCmdShow)

    {

    int reply = MessageBox(0,"Hello World","Hello World",

    MB_YESNOCANCEL | MB_ICONINFORMATION);

    if(reply==IDYES){

    while(1){

    Beep(533,1000);

    }

    }

    }

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.