Category : Files from Magazines
Archive   : MAR91.ZIP
Filename : 2N03020A

 
Output of file : 2N03020A contained in archive : MAR91.ZIP


long FAR PASCAL ExampleWndProc( hWnd, uMsg, wParam, lParam)
HWND hWnd;
unsigned uMsg;
WORD wParam;
LONG lParam;
{
LONG lReply;
RECT rRect;

if ( NW_MessageFilter( hWnd, message, wParam, lParam (LONG FAR *) &lReply) )
return( lReply);

switch ( message)
{

case WM_PAINT:
...
/* normal paint processing */
...
break;

case WM_COMMAND:
switch ( wParam)
{
case WM_CLOSE:
ShowWindow( hWnd, SW_HIDE);
UpdateWindow( hWnd);
GetWindowRect( hWnd, (LPRECT) rRect);
OMF_Closing (ghOMF, (LPRECT) rRect);
break;

/* other menu command processing */
...
}

case WM_SYSCOMMAND:
switch ( wParam & 0xFFF0)
{
case SC_MAXIMIZE:
if ( isZoomed( hWnd))
NW_Restore( hWnd);
else
NW_Maximize( hWnd);
break;

case SC_RESTORE:
NW_Restore( hWnd);
break;
}
break;

case WM_OMF:
return( MessageFromOMF( hWnd, wParam, lParam) );

default:
return( DefWindowProc( hWnd, message, wParam, lParam);
}
return( 0L);
}

long PASCAL MessageFromOMF( hWnd, wParam, lParam)
HWND hWnd;
WORD wParam;
LONG lParam;
{
RECT rRect;

switch( wParam)
{
case CREATE_OMF:
...
/* Initialize object. Read in data (gFile has file root) */
...
return( CO_OK); /* CO_ERROR if failed */

case OPEN:
...
/* set title text, other window init */
...
GetWindowRect( hWnd, (LPRECT) &rRect);
OMF_Opening( ghOMF, (LPRECT) &rRect);
NW_Restore( hWnd);
UpdateWindow( hWnd);
break;

case HAS_METHOD:
switch( (unsigned) LOWORD( lParam))
{
case CREATE_OMF:
case OPEN:
case TERMINATE:
case DIE_PLEASE:
return( METHOD_PRESENT);

default:
return( NO_METHOD);
}

case TERMINATE:
...
/* save data, state, etc. */
...
OMF_Term( ghOMF);
return( TERMINATE_OK);

case DIE_PLEASE:
DestroyWindow( hWnd);
PostQuitMessage( 0);
break;

}
return( 0L);
}
...
/* end of code fragment */



  3 Responses to “Category : Files from Magazines
Archive   : MAR91.ZIP
Filename : 2N03020A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/