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

📄 windowsapp.cpp

📁 The source code samples for chapter 2, 4, 6, and 8 are contained in the EvenChapters project. Those
💻 CPP
字号:
// WindowsApp.cpp : Defines the entry point for the application.

#include "stdafx.h"
#include "resource.h"
#include "mainwnd.h"

// The single, global ATL module
CComModule _Module;

// Entry point
int APIENTRY WinMain(HINSTANCE hinst,
                     HINSTANCE /*hinstPrev*/,
                     LPSTR     pszCmdLine,
                     int       nCmdShow)
{
  // Initialize the ATL module
  _Module.Init(0, hinst);

  // Create the main window
  CMainWindow wnd;

  // Load a menu
  HMENU hMenu = LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MENU));

  // Use the value 0 for the style and the extended style
  // to get the window traits for this class.
  wnd.Create(0, CWindow::rcDefault, __T("Windows Application"), 0, 0, (UINT)hMenu);
  if( !wnd ) return -1;
  
  // Show the main window
  wnd.CenterWindow();
  wnd.ShowWindow(nCmdShow);
  wnd.UpdateWindow();
  
  // Main message loop
  MSG msg;
  while( GetMessage(&msg, 0, 0, 0) ) {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }

  // Shutdown the ATL module
  _Module.Term();

  return msg.wParam;
}

⌨️ 快捷键说明

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