Directory:
- The interaction of the child window with the main window
- child window Controls
- Control 1
- Control 2
The interaction of the child window with the main window
Create window to: Register window type and create corresponding window instance
1 //Registration Window Type2Wndclass.style = Cs_hredraw |Cs_vredraw;3Wndclass.lpfnwndproc =WndProc;4Wndclass.cbclsextra =0 ;5Wndclass.cbwndextra =0 ;6Wndclass.hinstance =hinstance;7Wndclass.hicon =LoadIcon (NULL, idi_application);8Wndclass.hcursor =loadcursor (NULL, idc_arrow);9Wndclass.hbrbackground =(Hbrush) getstockobject (White_brush);TenWndclass.lpszmenuname =NULL; OneWndclass.lpszclassname =Szappname; A - if(! RegisterClass (&wndclass)) - { theMessageBox (NULL, TEXT ("This program requires Windows nt!"), - Szappname, mb_iconerror); - return 0 ; -}
Registration Window Type
1 //Creating a Window instance2hwnd = CreateWindow (Szappname,//window class name3TEXT ("The Hello program"),//Window Caption4Ws_overlappedwindow,//window Style5Cw_usedefault,//Initial x position6Cw_usedefault,//Initial y position7Cw_usedefault,//Initial x Size8Cw_usedefault,//Initial y size9Null//parent Window HandleTenNull//Window menu Handle OneHINSTANCE,//Program Instance handle ANULL);//Creation Parameters - - ShowWindow (hwnd, icmdshow); theUpdateWindow (HWND);
Creating a Window instance
Windows Programming--Child windows and child window controls