Share via


Creating the Main Window

You can create the window by calling the CreateWindow function. The Generic application creates the window as follows.

   hWnd = CreateWindow( TEXT("GenericAppClass"),
      TEXT("Generic Application"),
      WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,
      0,
      0,
      CW_USEDEFAULT,
      CW_USEDEFAULT,
      NULL,
      NULL,
      hInstance,
      NULL
   );

The first parameter is the name of the class that we registered. The remaining parameters specify other window attributes. This call creates the window, but the system does not display a window until the application calls the ShowWindow function. The Generic application displays the window as follows.

   ShowWindow( hWnd, nCmdShow );

See Also

Source Code

 

 

Build date: 3/25/2010