home *** CD-ROM | disk | FTP | other *** search
- #include "windows.h"
- #include "vbapi.h"
-
- /********************************************************************************************************************************
-
- Custom 3-D buttons for Visual Basic by Mark Gamber, March 1992
-
- This code may be freely distributed and modified. Because of this, it is not supported by the author.
-
- ********************************************************************************************************************************/
-
-
- LONG FAR PASCAL _export MainWndProc( HCTL, HWND, WORD, WORD, LONG ); /* Function prototypes */
- void PaintControl( HCTL, HWND );
- void AutoCheck( HCTL, HWND );
- BOOL _export FAR PASCAL SetColor( HWND, WORD, WORD, LONG );
- LONG _export FAR PASCAL PopupWndProc( HWND, WORD, WORD, LONG );
-
- typedef struct { /* Structure passed by hCtl */
- long Color;
- long CheckBorderColor;
- long ShadowColor;
- int Shadow;
- int Xsize, Ysize;
- int Selected;
- int ButtonDown;
- HFONT hFont;
- char Caption[ 129 ];
- } BTNSTRUCT;
-
- #define DEREF(hctl) ((BTNSTRUCT far *)VBDerefControl(hctl)) /* Method to access above structure using hCtl */
-
-
- /******************************************* Control Properties **************************************************/
-
- char ValueList[] = "0 - Unchecked\0"\
- "1 - Checked\0"\
- "";
-
- char *CLASSPOPUP = "CPopup";
-
- PROPINFO piValue =
- {
- "Value",
- DT_ENUM | PF_fSetMsg | PF_fGetMsg | PF_fSaveData,
- 0, 0, 0, ValueList, 1
- };
-
- PROPINFO piCheckColor =
- {
- "CheckColor",
- DT_COLOR | PF_fSetMsg | PF_fGetMsg | PF_fSaveData | PF_fEditable,
- 0, 0, NULL, 0
- };
-
- PROPINFO piCheckBorderColor =
- {
- "ChkBrdColor",
- DT_COLOR | PF_fSetMsg | PF_fGetMsg | PF_fSaveData | PF_fEditable,
- 0, 0, NULL, 0
- };
-
- PROPINFO piShadow =
- {
- "TextShadow",
- DT_BOOL | PF_fSetMsg | PF_fGetMsg | PF_fSaveData,
- 0, 0, NULL, 0
- };
-
- PROPINFO piShadowColor =
- {
- "TextShadowCol",
- DT_COLOR | PF_fSetMsg | PF_fGetMsg | PF_fSaveData,
- 0, 0, NULL, 0
- };
-
- PROPINFO piVersion =
- {
- "Version",
- DT_SHORT | PF_fGetMsg,
- 0, 0, NULL, 0
- };
-
- PPROPINFO proplistBtn[] = /* Properties supported by this control module */
- { /* Note: Does not have to be in a particular order */
- PPROPINFO_STD_CTLNAME,
- PPROPINFO_STD_CAPTION,
- PPROPINFO_STD_BACKCOLOR,
- PPROPINFO_STD_FORECOLOR,
- PPROPINFO_STD_LEFT,
- PPROPINFO_STD_TOP,
- PPROPINFO_STD_HEIGHT,
- PPROPINFO_STD_WIDTH,
- PPROPINFO_STD_INDEX,
- PPROPINFO_STD_FONTNAME,
- PPROPINFO_STD_FONTBOLD,
- PPROPINFO_STD_FONTITALIC,
- PPROPINFO_STD_FONTSTRIKE,
- PPROPINFO_STD_FONTUNDER,
- PPROPINFO_STD_FONTSIZE,
- PPROPINFO_STD_ENABLED,
- PPROPINFO_STD_MOUSEPOINTER,
- PPROPINFO_STD_TABINDEX,
- PPROPINFO_STD_TABSTOP,
- PPROPINFO_STD_DRAGICON,
- PPROPINFO_STD_DRAGMODE,
- &piValue,
- &piCheckColor,
- &piCheckBorderColor,
- &piShadow,
- &piShadowColor,
- &piVersion,
- NULL,
- };
-
- #define PROP_BASE 21 /* Definitions for easier property management */
- #define PROP_VALUE PROP_BASE
- #define PROP_COLOR (PROP_BASE+1)
- #define PROP_CHKBRDCOLOR (PROP_BASE+2)
- #define PROP_SHADOW (PROP_BASE+3)
- #define PROP_SHADOWCOLOR (PROP_BASE+4)
- #define PROP_VERSION (PROP_BASE+5)
-
- /*********************************************** Control Events **************************************************/
-
- EVENTINFO peClick = /* Description of "Click" event */
- {
- "Click",
- 0, 0, NULL, NULL
- };
-
- PEVENTINFO eventlistBtn[] = /* List of events supported by this control */
- { /* Note: This MUST be in alphabetical order */
- &peClick,
- PEVENTINFO_STD_DBLCLICK,
- PEVENTINFO_STD_GOTFOCUS,
- PEVENTINFO_STD_KEYDOWN,
- PEVENTINFO_STD_KEYPRESS,
- PEVENTINFO_STD_KEYUP,
- PEVENTINFO_STD_LOSTFOCUS,
- NULL
- };
-
- #define EVENT_CLICK 0
-
- char CONTROLNAME[] = "Radio3D";
-
- MODEL modelBtn = /* Model for custom checkbox control */
- { /* This is similar to registering a class in Windows */
- VB_VERSION,
- MODEL_fFocusOk | MODEL_fMnemonic, /* Ok to accept focus from form */
- (PCTLPROC)MainWndProc,
- NULL,
- WS_CHILD | BS_OWNERDRAW, /* Ownerdraw button */
- sizeof(BTNSTRUCT), /* Size of user-defined structure from above */
- 8000, /* Number of first bitmap used in toolbox */
- CONTROLNAME,
- CONTROLNAME, /* Control name */
- "button", /* Subclassing a Windows "button" control */
- proplistBtn,
- eventlistBtn /* Include property and event support lists */
- };
-
-
- /********************************************* Standard VB DLL Code sections *************************************************/
-
- HANDLE hmodDLL;
- HCTL ColorHctl;
- HWND ColorHwnd;
- WORD ColorID;
-
-
- BOOL FAR PASCAL LibMain( HANDLE hmod, HANDLE segDS, USHORT cbHeapSize ) /* Called when Windows loads the DLL */
- {
- hmodDLL = hmod; /* Save data selector in global variable */
- UnlockData( 0 ); /* Unlock the default data segment (Make it moveable) */
-
- return( TRUE );
- }
-
-
- BOOL FAR PASCAL _export VBINITCC( USHORT usVersion, BOOL fRunTime ) /* Called when VB loads the control */
- {
- if( ! fRunTime )
- {
- WNDCLASS wc;
-
- wc.style = 0;
- wc.lpfnWndProc = (WNDPROC)PopupWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hmodDLL;
- wc.hIcon = NULL;
- wc.hCursor = NULL;
- wc.hbrBackground = NULL;
- wc.lpszMenuName = NULL;
- wc.lpszClassName = CLASSPOPUP;
-
- if( ! RegisterClass( &wc ) )
- return( FALSE );
- }
- return( VBRegisterModel( hmodDLL, &modelBtn ) ); /* Just register the button(s) */
- }
-
-
-
- /********************************************** Window control procedure *****************************************************/
-
- /* Button control routine */
- LONG FAR PASCAL _export MainWndProc( HCTL hCtl, HWND hWnd, WORD msg, WORD wParam, LONG lParam )
- {
- switch( msg )
- {
- case VBN_DRAWITEM: /* Control needs repainted...same as WM_DRAWITEM */
- {
- LPDRAWITEMSTRUCT lpDs = (LPDRAWITEMSTRUCT)lParam;
- BTNSTRUCT far *Bs = DEREF( hCtl );
- TEXTMETRIC tm;
- RECT Rect;
-
- if( lpDs->itemAction & ODA_FOCUS )
- {
- if( Bs->hFont )
- SelectObject( lpDs->hDC, Bs->hFont );
-
- GetTextMetrics( lpDs->hDC, &tm );
- Rect.top = 0;
- Rect.left = 16;
- Rect.right = Bs->Xsize - 1;
- Rect.bottom = Bs->Ysize - 1;
-
- DrawFocusRect( lpDs->hDC, &Rect );
- return( FALSE );
- }
-
- Bs->ButtonDown = 0; /* Assume the control draw in "up" position */
- if( lpDs->itemAction & ODA_SELECT )
- if( lpDs->itemState & ODS_SELECTED ) /* If criteria matches, the button is down */
- Bs->ButtonDown = 1;
-
- PaintControl( hCtl, hWnd );
- Bs = DEREF( hCtl );
-
- return( FALSE );
- }
-
- case WM_SIZE: /* Support for Width and Height changes to control */
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- Bs->Xsize = LOWORD( lParam );
- Bs->Ysize = HIWORD( lParam );
- break;
- }
-
- case WM_SETFONT: /* If parent (VB) is setting a new font, support is here */
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- Bs->hFont = wParam;
- if( lParam ) /* If lParam is non-zero, repaint right now */
- PaintControl( hCtl, hWnd );
-
- return( FALSE );
- }
-
- case WM_GETFONT:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- return( Bs->hFont ); /* If requesting font used, return font handle */
- }
-
- case WM_SETTEXT: /* Support for CAPTION property */
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- lstrcpy( Bs->Caption, (LPSTR)lParam );
- InvalidateRect( hWnd, NULL, TRUE );
- return( FALSE );
- }
-
- case WM_GETTEXT:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- lstrcpy( (LPSTR)lParam, Bs->Caption );
- return( lstrlen( Bs->Caption ) );
- }
-
- case WM_GETTEXTLENGTH:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- return( lstrlen( Bs->Caption ) );
- }
-
- case VBM_SETPROPERTY:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- switch( wParam )
- {
- case PROP_VALUE:
- if( (BOOL)lParam )
- Bs->Selected = 1;
- else
- Bs->Selected = 0;
- PaintControl( hCtl, hWnd );
- return( FALSE );
-
- case PROP_COLOR:
- Bs->Color = lParam;
- PaintControl( hCtl, hWnd );
- return( FALSE );
-
- case PROP_CHKBRDCOLOR:
- Bs->CheckBorderColor = lParam;
- PaintControl( hCtl, hWnd );
- return( FALSE );
-
- case PROP_SHADOW:
- Bs->Shadow = (BOOL)lParam;
- PaintControl( hCtl, hWnd );
- return( FALSE );
-
- case PROP_SHADOWCOLOR:
- Bs->ShadowColor = lParam;
- PaintControl( hCtl, hWnd );
- return( FALSE );
- }
- break;
- }
-
- case VBM_GETPROPERTY:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- switch( wParam )
- {
- case PROP_VALUE:
- *(WORD far *)lParam = Bs->Selected;
- return( FALSE );
-
- case PROP_COLOR:
- *(LONG far *)lParam = Bs->Color;
- return( FALSE );
-
- case PROP_CHKBRDCOLOR:
- *(LONG far *)lParam = Bs->CheckBorderColor;
- return( FALSE );
-
- case PROP_SHADOW:
- *(BOOL far *)lParam = Bs->Shadow;
- return( FALSE );
-
- case PROP_SHADOWCOLOR:
- *(LONG far *)lParam = Bs->ShadowColor;
- return( FALSE );
-
- case PROP_VERSION:
- *(WORD far *)lParam = 100;
- return( FALSE );
- }
- break;
- }
-
- case WM_CHAR:
- if( wParam != 32 )
- break;
-
- case VBM_MNEMONIC:
- case WM_LBUTTONUP:
- {
- BTNSTRUCT far *Bs = DEREF( hCtl );
-
- if( ( LOWORD( lParam ) < Bs->Xsize && LOWORD( lParam >= 0 ) && HIWORD( lParam ) < Bs->Ysize && LOWORD( lParam ) >= 0 ) ||
- msg == WM_CHAR )
- VBFireEvent( hCtl, EVENT_CLICK, NULL );
-
- break;
- }
-
- case VBM_INITPROPPOPUP:
- {
- BTNSTRUCT far *Gp = DEREF( hCtl );
-
- switch( wParam )
- {
- case 2:
- case 3:
- case PROP_COLOR:
- case PROP_CHKBRDCOLOR:
- case PROP_SHADOWCOLOR:
- {
- FARPROC DlgProc;
-
- if( VBGetMode() == MODE_DESIGN )
- {
- ColorHctl = hCtl;
- ColorID = wParam;
- ColorHwnd = hWnd;
-
- return( CreateWindow( CLASSPOPUP, NULL, WS_POPUP, 0, 0, 0, 0,
- NULL, NULL, hmodDLL, NULL ) );
- }
- return( NULL );
- }
- }
- break;
- }
- }
- return( VBDefControlProc( hCtl, hWnd, msg, wParam, lParam ) ); /* If nothing done here, pass to VB default routine */
- }
-
-
- LONG _export FAR PASCAL PopupWndProc( HWND hWnd, WORD msg, WORD wParam, LONG lParam )
- {
- switch( msg )
- {
- case WM_SHOWWINDOW:
- if( wParam )
- {
- PostMessage( hWnd, WM_USER, 0, 0L );
- return( 0L );
- }
- break;
-
- case WM_USER:
- VBDialogBoxParam( hmodDLL, "SETCOLOR", MakeProcInstance( SetColor, hmodDLL ), 0L );
- return( 0L );
- }
- return( DefWindowProc( hWnd, msg, wParam, lParam ) );
- }
-
-
-
- BOOL _export FAR PASCAL SetColor( HWND hDlg, WORD msg, WORD wParam, LONG lParam )
- {
- switch( msg )
- {
- case WM_INITDIALOG:
- {
- BTNSTRUCT far *Gp = DEREF( ColorHctl );
- WORD Red, Green, Blue;
- DWORD dwColor;
- char str[ 6 ];
-
- VBGetControlProperty( ColorHctl, ColorID, &dwColor ); /* Get current color of property */
-
- if( dwColor & 0x80000000 ) /* If it's a system color offset, get system color */
- dwColor = GetSysColor( LOWORD( lParam ) + 1 );
-
- Red = GetRValue( dwColor ); /* Break color into components */
- Green = GetGValue( dwColor );
- Blue = GetBValue( dwColor );
-
- SetProp( hDlg, MAKEINTRESOURCE( 1 ), CreateSolidBrush( RGB ( Red, Green, Blue ) ) ); /* Save created brush */
-
- SetScrollRange( GetDlgItem( hDlg, 100 ), SB_CTL, 0, 255, TRUE ); /* Initialize scrollbar sizes */
- SetScrollRange( GetDlgItem( hDlg, 102 ), SB_CTL, 0, 255, TRUE );
- SetScrollRange( GetDlgItem( hDlg, 104 ), SB_CTL, 0, 255, TRUE );
-
- SetScrollPos( GetDlgItem( hDlg, 100 ), SB_CTL, Red, TRUE ); /* Initialze scrollbar positions */
- SetScrollPos( GetDlgItem( hDlg, 102 ), SB_CTL, Green, TRUE );
- SetScrollPos( GetDlgItem( hDlg, 104 ), SB_CTL, Blue, TRUE );
-
- wsprintf( str, "%d", Red );
- SetDlgItemText( hDlg, 101, str ); /* Change editbox text to reflect color comp. */
- wsprintf( str, "%d", Green );
- SetDlgItemText( hDlg, 103, str );
- wsprintf( str, "%d", Blue );
- SetDlgItemText( hDlg, 105, str );
- return( TRUE );
- }
-
- case WM_DRAWITEM:
- {
- LPDRAWITEMSTRUCT lpDs = (LPDRAWITEMSTRUCT)lParam;
-
- if( lpDs->CtlID == 106 )
- {
- RECT Rect;
- HDC hDC;
-
- hDC = GetDC( GetDlgItem( hDlg, lpDs->CtlID ) );
- SelectObject( hDC, GetProp( hDlg, MAKEINTRESOURCE( 1 ) ) );
- GetWindowRect( GetDlgItem( hDlg, lpDs->CtlID ), &Rect );
- Rectangle( hDC, 0, 0, Rect.right - Rect.left, Rect.bottom - Rect.top );
- SelectObject( lpDs->hDC, GetStockObject( NULL_BRUSH ) );
- }
- break;
- }
-
- case WM_HSCROLL:
- {
- DWORD dwColor;
- int Pos;
- char str[ 10 ];
- int junk;
-
- Pos = GetScrollPos( HIWORD( lParam ), SB_CTL );
-
- switch( wParam )
- {
- case SB_BOTTOM:
- SetScrollPos( HIWORD( lParam ), SB_CTL, 0, TRUE );
- break;
-
- case SB_TOP:
- SetScrollPos( HIWORD( lParam ), SB_CTL, 255, TRUE );
- break;
-
- case SB_THUMBPOSITION:
- case SB_THUMBTRACK:
- SetScrollPos( HIWORD( lParam ), SB_CTL, LOWORD( lParam ), TRUE );
- break;
-
- case SB_PAGEDOWN:
- if( Pos > 240 )
- SetScrollPos( HIWORD( lParam ), SB_CTL, 255, TRUE );
- else
- SetScrollPos( HIWORD( lParam ), SB_CTL, Pos + 16, TRUE );
- break;
-
- case SB_PAGEUP:
- if( Pos < 16 )
- SetScrollPos( HIWORD( lParam ), SB_CTL, 0, TRUE );
- else
- SetScrollPos( HIWORD( lParam ), SB_CTL, Pos - 16, TRUE );
- break;
-
- case SB_LINEDOWN:
- if( Pos < 255 )
- SetScrollPos( HIWORD( lParam ), SB_CTL, Pos + 1, TRUE );
- break;
-
- case SB_LINEUP:
- if( Pos > 0 )
- SetScrollPos( HIWORD( lParam ), SB_CTL, Pos - 1, TRUE );
- break;
- }
-
- wsprintf( str, "%d", GetScrollPos( GetDlgItem( hDlg, 100 ), SB_CTL ) );
- SetDlgItemText( hDlg, 101, str );
-
- wsprintf( str, "%d", GetScrollPos( GetDlgItem( hDlg, 102 ), SB_CTL ) );
- SetDlgItemText( hDlg, 103, str );
-
- wsprintf( str, "%d", GetScrollPos( GetDlgItem( hDlg, 104 ), SB_CTL ) );
- SetDlgItemText( hDlg, 105, str );
-
- dwColor = RGB( GetDlgItemInt( hDlg, 101, &junk, TRUE ),
- GetDlgItemInt( hDlg, 103, &junk, TRUE ),
- GetDlgItemInt( hDlg, 105, &junk, TRUE ) );
-
- DeleteObject( GetProp( hDlg, MAKEINTRESOURCE( 1 ) ) );
- SetProp( hDlg, MAKEINTRESOURCE( 1 ), CreateSolidBrush( dwColor ) );
-
- InvalidateRect( GetDlgItem( hDlg, 106 ), NULL, FALSE );
- break;
- }
-
- case WM_COMMAND:
- if( HIWORD( lParam ) == EN_KILLFOCUS )
- {
- DWORD dwColor;
- int junk;
-
- dwColor = RGB( GetDlgItemInt( hDlg, 101, &junk, TRUE ),
- GetDlgItemInt( hDlg, 103, &junk, TRUE ),
- GetDlgItemInt( hDlg, 105, &junk, TRUE ) );
-
- DeleteObject( GetProp( hDlg, MAKEINTRESOURCE( 1 ) ) );
- SetProp( hDlg, MAKEINTRESOURCE( 1 ), CreateSolidBrush( dwColor ) );
-
- InvalidateRect( GetDlgItem( hDlg, 106 ), NULL, FALSE );
- break;
- }
-
- if( wParam == IDOK || wParam == IDCANCEL )
- {
- if( wParam == IDOK )
- {
- int junk;
- DWORD dwColor;
- BTNSTRUCT far *Gp = DEREF( ColorHctl );
-
- dwColor = RGB( GetDlgItemInt( hDlg, 101, &junk, TRUE ),
- GetDlgItemInt( hDlg, 103, &junk, TRUE ),
- GetDlgItemInt( hDlg, 105, &junk, TRUE ) );
-
- VBSetControlProperty( ColorHctl, ColorID, dwColor );
- }
-
- DeleteObject( GetProp( hDlg, MAKEINTRESOURCE( 1 ) ) );
- RemoveProp( hDlg, MAKEINTRESOURCE( 1 ) );
-
- if( wParam == IDOK )
- {
- InvalidateRect( ColorHwnd, NULL, TRUE );
- return( TRUE );
- }
- EndDialog( hDlg, TRUE );
- return( TRUE );
- }
- break;
- }
- return( FALSE );
- }
-
-
- void PaintControl( HCTL hCtl, HWND hWnd ) /* Paint control using current style */
- {
- HPEN hPen;
- HDC hDC;
- HBRUSH hBrush;
- BTNSTRUCT far *Bs = DEREF( hCtl );
- RECT Rect;
- long OldColor;
-
- hDC = GetDC( hWnd );
-
- SelectObject( hDC, GetStockObject( BLACK_PEN ) ); /* Draw black button outline */
-
- MoveTo( hDC, 7, 0 );
- LineTo( hDC, 0, 7 );
- LineTo( hDC, 7, 14 );
- LineTo( hDC, 14, 7 );
- LineTo( hDC, 7, 0 );
-
- SelectObject( hDC, SendMessage( GetParent( hWnd ), WM_CTLCOLOR, hDC, MAKELONG( hWnd, 0 ) ) );
- SelectObject( hDC, CreatePen( PS_SOLID, 1, GetBkColor( hDC ) ) );
-
- FloodFill( hDC, 7, 2, RGB( 0, 0, 0 ) );
- Rectangle( hDC, 4, 4, 11, 11 );
-
- DeleteObject( SelectObject( hDC, CreatePen( PS_SOLID, 1, RGB( 128, 128, 128 ) ) ) ); /* Use dark gray pen first */
-
- if( ! Bs->ButtonDown ) /* If button is raised */
- {
- MoveTo( hDC, 7, 13 );
- LineTo( hDC, 13, 7 ); /* Draw lower and right lines */
- LineTo( hDC, 7, 1 );
- }
- else
- {
- MoveTo( hDC, 7, 1 );
- LineTo( hDC, 1, 7 );
- LineTo( hDC, 7, 13 );
- }
-
- DeleteObject( SelectObject( hDC, GetStockObject( WHITE_PEN ) ) );
- if( ! Bs->ButtonDown )
- {
- MoveTo( hDC, 7, 1 );
- LineTo( hDC, 1, 7 );
- LineTo( hDC, 7, 13 );
- }
-
- if( Bs->Selected )
- SelectObject( hDC, CreatePen( PS_SOLID, 1, Bs->CheckBorderColor ) );
- else
- SelectObject( hDC, CreatePen( PS_SOLID, 1, RGB( 192, 192, 192 ) ) );
-
- MoveTo( hDC, 7 + Bs->ButtonDown, 4 );
- LineTo( hDC, 4 + Bs->ButtonDown, 7 );
- LineTo( hDC, 7 + Bs->ButtonDown, 10 );
- LineTo( hDC, 10 + Bs->ButtonDown, 7 );
- LineTo( hDC, 7 + Bs->ButtonDown, 4 );
-
- if( Bs->Selected )
- {
- if( ! Bs->ButtonDown )
- SetPixel( hDC, 11, 7, RGB( 192, 192, 192 ) );
- DeleteObject( SelectObject( hDC, CreatePen( PS_SOLID, 1, Bs->Color ) ) );
- }
- else
- DeleteObject( SelectObject( hDC, CreatePen( PS_SOLID, 1, RGB( 192, 192, 192 ) ) ) );
-
- MoveTo( hDC, 5 + Bs->ButtonDown, 7 );
- LineTo( hDC, 10 + Bs->ButtonDown, 7 );
- MoveTo( hDC, 7 + Bs->ButtonDown, 5 );
- LineTo( hDC, 7 + Bs->ButtonDown, 10 );
- MoveTo( hDC, 6 + Bs->ButtonDown, 6 );
- LineTo( hDC, 9 + Bs->ButtonDown, 6 );
- MoveTo( hDC, 6 + Bs->ButtonDown, 8 );
- LineTo( hDC, 9 + Bs->ButtonDown, 8 );
-
- DeleteObject( SelectObject( hDC, GetStockObject( NULL_PEN ) ) );
-
- if( Bs->hFont )
- SelectObject( hDC, Bs->hFont );
-
- if( Bs->Shadow )
- {
- Rect.left = 18;
- Rect.right = Bs->Xsize + 18;
- Rect.top = 1;
- Rect.bottom = Bs->Ysize + 1;
-
- OldColor = GetTextColor( hDC );
- SetTextColor( hDC, Bs->ShadowColor );
- DrawText( hDC, Bs->Caption, lstrlen( Bs->Caption ), &Rect, DT_LEFT | DT_TOP );
- SetTextColor( hDC, OldColor );
- SetBkMode( hDC, TRANSPARENT );
- }
-
- Rect.left = 18 + ( Bs->Shadow != 0 );
- Rect.top = 1 + ( Bs->Shadow != 0 );
- Rect.right = Bs->Xsize + 18 + ( Bs->Shadow != 0 );
- Rect.bottom = Bs->Ysize + 1 + ( Bs->Shadow != 0 );
-
- DrawText( hDC, Bs->Caption, lstrlen( Bs->Caption ), &Rect, DT_LEFT | DT_TOP );
-
- SelectObject( hDC, GetStockObject( ANSI_FIXED_FONT ) );
- ReleaseDC( hWnd, hDC );
- }
-
-
-
-