首页 > Windows开发 > 详细

windows 编程 —— 子窗口 与 子窗口控件

时间:2016-03-31 09:25:46      阅读:311      评论:0      收藏:0      [点我收藏+]

目录:

  • 子窗口与主窗口的交互
  • 子窗口控件 
  1. 控件1
  2. 控件2    
  3.        

子窗口与主窗口的交互

创建窗口要:注册窗口类型 和 创造相应窗口实例

技术分享
 1      //注册窗口类型
 2      wndclass.style         = CS_HREDRAW | CS_VREDRAW ;
 3      wndclass.lpfnWndProc   = WndProc ;
 4      wndclass.cbClsExtra    = 0 ;
 5      wndclass.cbWndExtra    = 0 ;
 6      wndclass.hInstance     = hInstance ;
 7      wndclass.hIcon         = LoadIcon (NULL, IDI_APPLICATION) ;
 8      wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
 9      wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
10      wndclass.lpszMenuName  = NULL ;
11      wndclass.lpszClassName = szAppName ;
12 
13      if (!RegisterClass (&wndclass))
14      {
15           MessageBox (NULL, TEXT ("This program requires Windows NT!"), 
16                       szAppName, MB_ICONERROR) ;
17           return 0 ;
18      }
注册窗口类型
技术分享
 1 //创建窗口实例
 2 hwnd = CreateWindow (szAppName,                  // window class name
 3                           TEXT ("The Hello Program"), // window caption
 4                           WS_OVERLAPPEDWINDOW,        // window style
 5                           CW_USEDEFAULT,              // initial x position
 6                           CW_USEDEFAULT,              // initial y position
 7                           CW_USEDEFAULT,              // initial x size
 8                           CW_USEDEFAULT,              // initial y size
 9                           NULL,                       // parent window handle
10                           NULL,                       // window menu handle
11                           hInstance,                  // program instance handle
12                           NULL) ;                     // creation parameters
13      
14      ShowWindow (hwnd, iCmdShow) ;
15      UpdateWindow (hwnd) ;
创建窗口实例

 

windows 编程 —— 子窗口 与 子窗口控件

原文:http://www.cnblogs.com/BensonLaur/p/5339846.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!