Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ShadowButton.h
Package: CQQFind.rar [view]
Upload User: cxh888fhc
Upload Date: 2017-07-08
Package Size: 240k
Code Size: 3k
Category:
Hook api
Development Platform:
Visual C++
- ////////////////////////////////////////////////////////////////////
- // 类名: CShadowButton
- //
- // 说明: 类似于原DOS下的阴影效果按钮
- //
- // 用法:
- // 1、把文件shadowbutton.h、shadowbutton.cpp加入工程中
- // 2、在使用的对话框中加入头文件,#include shadowbutton.h
- // 3、声明要改变的按钮成员变量(可在类向导中进行),如:
- // CShadowButton m_Cancel;
- // 4、在OnInitDialog()中加入下面语句,进行初始化
- // m_Cancel.SetDefaultFace();
- // m_Cancel.SetDefaultButton();
- //
- // 修改: 徐景周, 加入PreSubclassWindow(),实现按钮构造时自绘属性.
- /////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SHADOWBUTTON_H__F2E1D200_7147_11D5_98C1_8B96D28F4E0A__INCLUDED_)
- #define AFX_SHADOWBUTTON_H__F2E1D200_7147_11D5_98C1_8B96D28F4E0A__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // shadowbutton.h : header file
- /////////////////////////////////////////////////////////////////////////////
- // CShadowButton window
- class CShadowButton : public CButton
- {
- // Construction
- public:
- CShadowButton();
- // Attributes
- public:
- // Operations
- public:
- void SetShadowSize(CSize cs)
- {
- m_sizeShadow.cx = cs.cx;
- m_sizeShadow.cy = cs.cy;
- Redraw();
- }
- protected:
- BOOL m_bDefault;
- COLORREF m_crBorderColor;
- COLORREF m_crColor;
- COLORREF m_crShadowColor;
- COLORREF m_crTextColor;
- COLORREF m_crTransColor;
- CSize m_sizeShadow;
- int m_nBorderSize;
- int m_nShadowXOffset;
- int m_nShadowYOffset;
- CBitmap m_bmpNormal;
- CBitmap m_bmpDisabled;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CShadowButton)
- public:
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- protected:
- virtual void PreSubclassWindow();
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void SetDefaultFace();
- BOOL SetDefaultButton( BOOL bState = TRUE );
- void SetShadowOffset(int x, int y);
- BOOL LoadBitmaps(COLORREF crTransColor, UINT nresNormalBmp, UINT nresDisabledBmp = 0);
- void SetColors(COLORREF crColor, COLORREF crBorder, COLORREF crShadow, COLORREF crText);
- void SetBorderSize(int nSize);
- void Redraw();
- virtual ~CShadowButton();
- // Generated message map functions
- protected:
- void DrawClient(CDC *pdc, CRect *pRect, int x, int y);
- void DrawDown(CDC *pDC, CRect *pRect);
- void DrawUp(CDC *pDC, CRect *pRect);
- //{{AFX_MSG(CShadowButton)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_SHADOWBUTTON_H__F2E1D200_7147_11D5_98C1_8B96D28F4E0A__INCLUDED_)