home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / FUNCTION / BARTOOLS.C < prev    next >
C/C++ Source or Header  |  1994-06-07  |  2KB  |  50 lines

  1. #include <WinTen.h>
  2. #include <Windows.h>
  3. #include <ClipApi.h>
  4.  
  5. #define BAR_TOP     1
  6. #define BAR_LEFT    2
  7. #define BAR_RIGHT   3
  8. #define BAR_ADJUST  4
  9.  
  10. //----------------------------------------------------------------------------//
  11.  
  12. CLIPPER BarAdjust()
  13. {
  14.    HWND hWnd    = _parni( 1 );
  15.    BYTE bMode   = _parni( 2 );
  16.    BOOL bMsgBar = _parl( 3 );
  17.    HWND hParent = GetParent( hWnd );
  18.    RECT rcWnd, rcParent;
  19.  
  20.    GetClientRect( hWnd, &rcWnd );
  21.    GetClientRect( hParent, &rcParent );
  22.  
  23.    switch( bMode )
  24.    {
  25.       case BAR_TOP:
  26.            SetWindowPos( hWnd, 0, -1, -1,
  27.                          rcParent.right - rcParent.left + 2,
  28.                          rcWnd.bottom - rcWnd.top + 2, SWP_NOZORDER );
  29.            break;
  30.  
  31.       case BAR_LEFT:
  32.            SetWindowPos( hWnd, 0, -1, -1, rcWnd.right - rcWnd.left + 2,
  33.                          rcParent.bottom + 1 - IF( bMsgBar, 24, 0 ), SWP_NOZORDER );
  34.            break;
  35.  
  36.       case BAR_RIGHT:
  37.            SetWindowPos( hWnd, 0, rcParent.right - ( rcWnd.right - rcWnd.left ),
  38.                          -1, rcWnd.right - rcWnd.left + 2,
  39.                          rcParent.bottom + 1 - IF( bMsgBar, 24, 0 ), SWP_NOZORDER );
  40.            break;
  41.  
  42.       case BAR_ADJUST:
  43.            SetWindowPos( hWnd, 0, -1, -1, rcParent.right + 2,
  44.                          rcParent.bottom + 1 - IF( bMsgBar, 24, 0 ), SWP_NOZORDER );
  45.            break;
  46.    }
  47. }
  48.  
  49. //----------------------------------------------------------------------------//
  50.