zoukankan      html  css  js  c++  java
  • API模板

     1 #include <windows.h>
     2 #include <windowsx.h>
     3 
     4 #define DIVISIONS 5
     5 
     6 LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
     7 
     8 int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
     9                     PSTR szCmdLine, int iCmdShow)
    10 {
    11      static TCHAR szAppName[] = TEXT ("Checker2") ;
    12      HWND         hwnd ;
    13      MSG          msg ;
    14      WNDCLASS     wndclass ;
    15 
    16      wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
    17      wndclass.lpfnWndProc   = WndProc ;
    18      wndclass.cbClsExtra    = 0 ;
    19      wndclass.cbWndExtra    = 0 ;
    20      wndclass.hInstance     = hInstance ;
    21      wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
    22      wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
    23      wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
    24      wndclass.lpszMenuName  = NULL ;
    25      wndclass.lpszClassName = szAppName ;
    26      
    27      if (!RegisterClass (&wndclass))
    28      {
    29           MessageBox (NULL, TEXT ("Program requires Windows NT!"), 
    30                       szAppName, MB_ICONERROR) ;
    31           return 0 ;
    32      }
    33      
    34      hwnd = CreateWindow (szAppName, TEXT ("Checker2 Mouse Hit-Test Demo"),
    35                           WS_OVERLAPPEDWINDOW,
    36                           CW_USEDEFAULT, CW_USEDEFAULT,
    37                           CW_USEDEFAULT, CW_USEDEFAULT,
    38                           NULL, NULL, hInstance, NULL) ;
    39      
    40      ShowWindow (hwnd, iCmdShow) ;
    41      UpdateWindow (hwnd) ;
    42      
    43      while (GetMessage (&msg, NULL, 0, 0))
    44      {
    45           TranslateMessage (&msg) ;
    46           DispatchMessage (&msg) ;
    47      }
    48      return msg.wParam ;
    49 }
    50 
    51 LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    52 {
    1   EndPaint (hwnd, &ps) ;
    2           return 0 ;
    3                
    4      case WM_DESTROY :
    5           PostQuitMessage (0) ;
    6           return 0 ;
    7      }
    8      return DefWindowProc (hwnd, message, wParam, lParam) ;
    9 }
  • 相关阅读:
    elasticsearch为什么比mysql快
    elasticsearch(lucene)索引数据过程
    UidGenerator springboot2集成篇
    StampedLock的理解和使用
    EsClientRHL-elasticsearch java客户端开源工具
    Spring只定义接口自动代理接口实现类
    浅谈浏览器存储(cookie、localStorage、sessionStorage)
    图片无缝拼接
    js中变量的连续赋值
    web页面ios浏览器img图片的坑
  • 原文地址:https://www.cnblogs.com/Zblogs/p/3262183.html
Copyright © 2011-2022 走看看