#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>

WORD GetResources( void );

extern HANDLE __hInstance;

//----------------------------------------------------------------------------//

BOOL PASCAL _export DlgWndProc( HWND hDlg, WORD wMsg, WORD wParam, LONG lParam )
{
   switch( wMsg )
   {
      case WM_INITDIALOG:
           return TRUE;

      case WM_COMMAND:
           switch( wParam )
           {
              case IDOK:
                   EndDialog( hDlg, IDOK );
                   break;

              case IDCANCEL:
                   EndDialog( hDlg, IDCANCEL );
                   break;
           }
           break;
   }
   return FALSE;
}

//----------------------------------------------------------------------------//

CLIPPER nDlgBox()
{
   FARPROC DialogProc = MakeProcInstance( ( FARPROC ) DlgWndProc, __hInstance );
   WORD    wResult;

   wResult = DialogBox( GetResources() ? GetResources(): __hInstance,
                        ( LPSTR ) _parc( 1 ), GetActiveWindow(),
                        DialogProc );
   FreeProcInstance( DlgWndProc );
   _retni( wResult );
}

//----------------------------------------------------------------------------//
