home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12315.ZIP / ARCP.C next >
C/C++ Source or Header  |  1989-05-25  |  2KB  |  86 lines

  1. #define INCL_GPI
  2. #define INCL_WIN
  3.  
  4. #include <os2.h>
  5. #include <stddef.h>
  6. #include "stdlib.h"
  7. #include "hello.h"
  8. #include "arcp.h"
  9.  
  10. VOID SetDialogItemLong(HWND,USHORT,LONG);
  11. LONG GetDialogItemLong(HWND,USHORT);
  12.  
  13. PFNWP pfnOldFrameProc;
  14. RECTL  rRect;
  15.  
  16. MRESULT FAR PASCAL ArcParamDlg2( HWND , USHORT , MPARAM , MPARAM  );
  17.  
  18. HWND   EP,EQ,ER,ES;
  19. ARCPARAMS   AP;
  20.  
  21.  
  22. /* This is the proc for the inner dialog box.  It contains the controls
  23.    etc.*/
  24.  
  25. MRESULT FAR PASCAL ArcParamDlg2( hWndDlg, message, mp1, mp2)
  26. HWND   hWndDlg;
  27. USHORT message;
  28. MPARAM mp1;
  29. MPARAM mp2;
  30. {
  31.  
  32. switch( message )
  33.     {
  34.     case WM_COMMAND:
  35.         switch( SHORT1FROMMP(mp1) )
  36.         {
  37.       case DID_OK:
  38.         /* must dismiss parent dialog*/
  39.         WinDismissDlg( WinQueryWindow(hWndDlg,QW_PARENT,FALSE), TRUE );
  40.             break;
  41.  
  42.         default:
  43.             return( FALSE );
  44.         }
  45.         break;
  46.  
  47.     default:
  48.     return( WinDefDlgProc( hWndDlg, message, mp1, mp2) );
  49.     }
  50.  
  51. return( FALSE );
  52. }
  53.  
  54.  
  55.  
  56. /* Outer frame (dlgbox) dialog procedure.  The icon will actually belong
  57.    to this window.  Note: During WM_INITDLG time I set the icon and
  58.    load the inner dialog box which contains the controls. */
  59.  
  60. MRESULT FAR PASCAL ArcParamDlg( HWND hWnd, USHORT message, MPARAM mp1, MPARAM mp2 )
  61. {
  62.  
  63.     switch ( message )
  64.     {
  65.     HPOINTER hptr;
  66.     SWP      swp;
  67.     case WM_INITDLG:
  68.         hptr = WinLoadPointer(HWND_DESKTOP,NULL,IDD_ARCICO);
  69.         WinSendMsg(hWnd,WM_SETICON,(MPARAM)hptr,0L);
  70.  
  71.         WinLoadDlg( hWnd, hWnd, ArcParamDlg2, NULL, IDD_ARCPARAM2, NULL );
  72.         /* The following code is there to get the client initially sized.*/
  73.         /* Get a copy of the current client window size and style flags */
  74.         WinQueryWindowPos( hWnd, &swp );
  75.         /* Size and position this new client window using above info. */
  76.         WinSetWindowPos( hWnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx+1, swp.cy+1, swp.fs | SWP_MOVE | SWP_SIZE | SWP_ZORDER );
  77.  
  78.         break;
  79.  
  80.  
  81.         default:
  82.         return( WinDefDlgProc(hWnd, message, mp1, mp2 ));
  83.     }
  84.     return (FALSE);
  85. }
  86.