⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 c+++ game uploading now
💻 CPP
字号:
/**
 @file
 The WinMain() function.
*/

#include <exception>
#include <windows.h>
#include "lib/WinException.h"
#include "lib/MessageLoop.h"
#include "lib/Accelerator.h"
#include "lib/MessageBox.h"
#include "NewHandler.h"
#include "TopWindow.h"
#include "resource.h"

using namespace Win;


/** application instance */
HINSTANCE TheInstance=0;


int WINAPI WinMain
   (HINSTANCE hInst, HINSTANCE hPrevInst, char * cmdParam, int cmdShow)
{
    try
    {
        //initialize application instance
        TheInstance=hInst;
        
        //register new out of memory handler, throwing Win::Exception
        OutOfMemory::RegisterNewHandler();

        //create main "window||dialog"
        TopWindow topWindow(hInst);
    
        //load the accelerator table
        Accelerator accel(hInst, MAKEINTRESOURCE(IDR_ACCELERATOR1));

        //our message loop, uses keyboard accelerators
        MessageLoop msgloop(topWindow, accel);

        //now run the message loop
        return msgloop.Run();
    }
    catch(Win::Exception &e)
    {
        e.Show();
    }
    catch(...)
    {
        Win::MessageBox(0, "Unknown Exception", "Shylock",
                        MB_ICONEXCLAMATION|MB_OK);
    }
    return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -