home *** CD-ROM | disk | FTP | other *** search
-
- a) main-Funktion:
-
- ======================================================
- int cdecl main( )
- {
- hab = WinInitialize( NULL );
- hmq = WinCreateMsgQueue( hab, 0 );
-
- WinRegisterClass( ... );
-
- hwndFrame = WinCreateStdWindow( ... );
-
- while( WinGetMsg( ... )
- WinDispatchMsg( ... );
-
- WinDestroyWindow( hwndFrame );
- WinDestroyMsgQueue( hmq );
- WinTerminate( hab );
-
- return 0;
- }
- ======================================================
-
-
-
- b) Window-Funktion:
-
- ======================================================
- MRESULT EXPENTRY ClientWindowProc( HWND hwnd, USHORT msg,
- MPARAM mp1, MPARAM mp2 )
- {
- switch( msg )
- {
-
- case ...: /* z. B. WM_CREATE */
- ...
- return 0;
-
-
- ...
-
-
- case WM_CLOSE:
- WinPostMsg( hwnd, WM_QUIT, 0L, 0L );
- break;
-
- case ...:
- ...
- return 0;
-
-
- ...
-
-
- default:
- /* für alle anderen Fälle muß(!) dieser Aufruf existieren */
- return WinDefWindowProc( hwnd, msg, mp1, mp2 );
- }
- return 0;
- }
-
- ======================================================
-