FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
August 01, 2000

A Lightweight Window Wrapper

(Page 5 of 5)
August 2000/A Lightweight Window Wrapper/Listing 4

Listing 4: Sample application WinMain

#include <windows.h>
#include "WndObj.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,
                   LPSTR lpszCmdLine, int nCmdShow)
{
    CMainWindow MainWindow;
    CChildWindow ChildWindow;

    //Create the window objects.
    if(NULL == MainWindow.Create(CW_USEDEFAULT, CW_USEDEFAULT,
        CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance))
        return FALSE;
    
    if(NULL == ChildWindow.Create(CW_USEDEFAULT, CW_USEDEFAULT,
        350, 100, MainWindow._hwnd, NULL, hInstance))
        return FALSE;

    MSG Msg; 
    while(GetMessage(&Msg, NULL, 0, 0))
      DispatchMessage(&Msg);

    return Msg.wParam;
}
Previous Page | 1 | 2 | 3 | 4 | 5
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK