home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1990
/
07
/
grdlagen
/
os2funkt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-20
|
1KB
|
64 lines
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;
}
======================================================