proj.c

来自「allows the user to select files containi」· C语言 代码 · 共 87 行

C
87
字号
#define STRICT
#include <windows.h>
#include <windowsx.h>

#include "main.h"
#include "resource.h"


#define CLASS_NAME "ProjClass"


/*
 * Initializes the application
 */

BOOL InitApplication(HANDLE hInstance)
{
   WNDCLASS wc;
   
   wc.style = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc = (WNDPROC) Proj_WndProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
   wc.hInstance = hInstance;
   wc.hIcon = NULL;
   wc.hCursor = LoadCursor(NULL, IDC_ARROW);
   wc.hbrBackground = GetStockObject(WHITE_BRUSH);
   wc.lpszMenuName = MAKEINTRESOURCE (IDR_MAIN_MENU);
   wc.lpszClassName = CLASS_NAME;

   return RegisterClass(&wc);
}


/*
 * Initializes the instance
 */
BOOL InitInstance(HANDLE hInstance, int CmdShow)
{
  HWND hWnd;
  
  hWnd = CreateWindow(CLASS_NAME,
                      "Projetions",
                      WS_OVERLAPPEDWINDOW,
                      CW_USEDEFAULT,
                      CW_USEDEFAULT,
                      CW_USEDEFAULT,
                      CW_USEDEFAULT,
                      NULL,
                      NULL,
                      hInstance,
                      NULL);
  if(!hWnd)
    return FALSE;


  ShowWindow(hWnd, CmdShow);
  UpdateWindow(hWnd);

  return TRUE;

}




/*
 * Main function
 */
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPSTR CmdLine, int CmdShow)
{
  MSG msg;
  
  if(!InitApplication (hInstance))
    return FALSE;
  
  if(!InitInstance (hInstance, CmdShow))
    return FALSE;

  while(GetMessage (&msg, NULL, 0, 0)) {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }
  
  return msg.wParam;
}

⌨️ 快捷键说明

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