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 }
  • 相关阅读:
    iOS 获取手机当前所连接的网络的IP地址
    np.delete详解
    np.concatenate函数
    说说如何在 Python 中使用日志
    Python os.getcwd() 方法
    python的构造函数
    python引入自己写的Py文件
    VS CODE编译Python输出中文乱码
    VScode中pytorch出现Module 'torch' has no 'xx' member错误
    matlab处理hd5高维数据
  • 原文地址:https://www.cnblogs.com/Zblogs/p/3262183.html
Copyright © 2011-2022 走看看