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

  1. #include <WinTen.h>
  2. #include <Windows.h>
  3. #include <ClipApi.h>
  4.  
  5. #define TRANSPARENT          1
  6. #define OPAQUE               2
  7. #define CLR_BLACK            0
  8. #define CLR_GRAY       8421504   // RGB( 128, 128, 128 )
  9. #define CLR_LIGHTGRAY 12632256   // RGB( 192, 192, 192 )
  10. #define CLR_WHITE     16777215   // RGB( 255, 255, 255 )
  11. #define CLR_CYAN       8421376   // RGB(   0, 128, 128 )
  12. #define CLR_LIGHTCYAN 16776960   // RGB(   0, 255, 255 )
  13. #define CLR_BLUE       8388608   // RGB(   0,   0, 128 )
  14.  
  15. //----------------------------------------------------------------------------//
  16.  
  17. CLIPPER Say3D()  // ( hWnd,hDc, cCaption, lRaised, lCentered )
  18. {
  19.    HWND   hWnd      = _parni( 1 );
  20.    HDC    hDC       = _parni( 2 );
  21.    LPBYTE cCaption  = _parc( 3 );
  22.    WORD   wLen      = _parclen( 3 );
  23.    BOOL   bRaised   = ! _parl( 4 );
  24.    WORD   wCentered = _parl( 5 ) ? DT_CENTER : 0;
  25.    HFONT  hFont     = _parni( 6 );
  26.    HFONT  hOldFont;
  27.    RECT   rc;
  28.  
  29.    GetClientRect( hWnd, &rc );
  30.    SetTextColor( hDC, CLR_WHITE );
  31.    SetBkColor( hDC, CLR_LIGHTGRAY );
  32.  
  33.    rc.bottom++;
  34.    FillRect( hDC, &rc, GetStockObject( LTGRAY_BRUSH ) );
  35.    rc.bottom--;
  36.  
  37.    if( ! bRaised )
  38.    {
  39.       rc.top++;
  40.       rc.left++;
  41.    }
  42.    if( hFont )
  43.       hOldFont = SelectObject( hDC, hFont );
  44.  
  45.    DrawText( hDC, cCaption, wLen, &rc, DT_NOCLIP | wCentered );
  46.  
  47.    SetTextColor( hDC, CLR_BLACK );
  48.    SetBkMode( hDC, TRANSPARENT );
  49.    if( ! bRaised )
  50.    {
  51.       rc.top--;
  52.       rc.left--;
  53.    }
  54.    else
  55.    {
  56.       rc.top++;
  57.       rc.left++;
  58.    }
  59.    DrawText( hDC, cCaption, wLen, &rc, DT_NOCLIP | wCentered );
  60.  
  61.    if( hFont )
  62.       SelectObject( hDC, hOldFont );
  63. }
  64.  
  65. //----------------------------------------------------------------------------//
  66.