資源簡介
實現MFC按鈕美化的源碼案例,包含各種樣式的按鈕貼圖,ico BMP 等,點擊按鈕發出聲音多功能的實現

代碼片段和文件信息
//*************************************************************************
//?BCMenu.cpp?:?implementation?file
//?Version?:?3.02
//?Date?:?March?2002
//?Author?:?Brent?Corkum
//?Email?:??corkum@rocscience.com
//?Latest?Version?:?http://www.rocscience.com/~corkum/BCMenu.html
//?
//?Bug?Fixes?and?portions?of?code?supplied?by:
//
//?Ben?AshleyGirish?BharadwajJean-Edouard?Lachand-Robert
//?Robert?Edward?CaldecottKenny?GoersLeonardo?Zide
//?Stefan?KuhrReiner?JungMartin?VladicKim?Yoo?Chul
//?Oz?SolomonovichTongzhe?CuiStephane?ClogWarren?Stevens
//?Damir?ValiulinDavid?KinderMarc?Loiry
//
//?You?are?free?to?use/modify?this?code?but?leave?this?header?intact.
//?This?class?is?public?domain?so?you?are?free?to?use?it?any?of
//?your?applications?(FreewareSharewareCommercial).?All?I?ask?is
//?that?you?let?me?know?so?that?if?you?have?a?real?winner?I?can
//?brag?to?my?buddies?that?some?of?my?code?is?in?your?app.?I?also
//?wouldn‘t?mind?if?you?sent?me?a?copy?of?your?application?since?I
//?like?to?play?with?new?stuff.
//*************************************************************************
#include?“stdafx.h“????????//?Standard?windows?header?file
#include?“BCMenu.h“????????//?BCMenu?class?declaration
#include????????//SK:?makes?A2W?and?other?spiffy?AFX?macros?work
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
#define?BCMENU_GAP?1
#ifndef?OBM_CHECK
#define?OBM_CHECK?32760?//?from?winuser.h
#endif
#if?_MFC_VER?<0x400
#error?This?code?does?not?work?on?Versions?of?MFC?prior?to?4.0
#endif
static?CPINFO?CPInfo;
//?how?the?menu‘s?are?drawn?in?win9x/NT/2000
UINT?BCMenu::original_drawmode=BCMENU_DRAWMODE_ORIGINAL;
BOOL?BCMenu::original_select_disabled=TRUE;
//?how?the?menu‘s?are?drawn?in?winXP
UINT?BCMenu::xp_drawmode=BCMENU_DRAWMODE_XP;
BOOL?BCMenu::xp_select_disabled=FALSE;
BOOL?BCMenu::xp_draw_3D_bitmaps=TRUE;
CImageList?BCMenu::m_AllImages;
CArray?BCMenu::m_AllImagesID;
enum?Win32Type{
Win32s
WinNT3
Win95
Win98
WinME
WinNT4
Win2000
WinXP
};
Win32Type?IsShellType()
{
Win32Type??ShellType;
DWORD?winVer;
OSVERSIONINFO?*osvi;
winVer=GetVersion();
if(winVer<0x80000000){/*NT?*/
ShellType=WinNT3;
osvi=?(OSVERSIONINFO?*)malloc(sizeof(OSVERSIONINFO));
if?(osvi!=NULL){
memset(osvi0sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(osvi);
if(osvi->dwMajorVersion==4L)ShellType=WinNT4;
else?if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==0L)ShellType=Win2000;
else?if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==1L)ShellType=WinXP;
free(osvi);
}
}
else?if??(LOBYTE(LOWORD(winVer))<4)
ShellType=Win32s;
else{
ShellType=Win95;
osvi=?(OSVERSIONINFO?*)malloc(sizeof(OSVERSIONINFO));
if?(osvi!=NULL){
memset(osvi0sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????88816??2002-03-31?11:20??CButtonST_demo\BCMenu.cpp
?????文件??????16478??2002-03-31?11:20??CButtonST_demo\BCMenu.h
?????文件??????14076??2002-07-26?17:08??CButtonST_demo\BkDialogST.cpp
?????文件???????3712??2002-07-26?17:04??CButtonST_demo\BkDialogST.h
?????文件??????69988??2003-03-03?22:04??CButtonST_demo\BtnST.cpp
?????文件??????10401??2015-10-23?15:09??CButtonST_demo\BtnST.h
?????文件?????629364??2015-11-14?20:35??CButtonST_demo\CButtonST_Demo.aps
?????文件???????5490??2015-11-14?20:37??CButtonST_demo\CButtonST_Demo.clw
?????文件????????976??2001-10-13?17:36??CButtonST_demo\CButtonST_Demo.cpp
?????文件??????12144??2002-11-26?11:43??CButtonST_demo\CButtonST_Demo.dsp
?????文件????????551??2001-05-12?13:40??CButtonST_demo\CButtonST_Demo.dsw
?????文件????????933??2001-05-12?13:49??CButtonST_demo\CButtonST_Demo.h
?????文件?????353280??2015-11-14?20:37??CButtonST_demo\CButtonST_Demo.ncb
?????文件??????52736??2015-11-14?20:37??CButtonST_demo\CButtonST_Demo.opt
?????文件???????3316??2015-10-23?14:16??CButtonST_demo\CButtonST_Demo.plg
?????文件??????13266??2003-03-03?22:01??CButtonST_demo\CButtonST_Demo.rc
?????文件???????2237??2002-07-09?08:56??CButtonST_demo\CButtonST_DemoDlg.cpp
?????文件???????1067??2001-05-12?14:14??CButtonST_demo\CButtonST_DemoDlg.h
?????文件???????8684??2001-12-03?16:54??CButtonST_demo\CeXDib.cpp
?????文件???????2328??2001-12-04?10:23??CButtonST_demo\CeXDib.h
?????文件????????659??2002-11-25?14:05??CButtonST_demo\Disclaimer.txt
?????文件???????1451??2002-04-17?16:20??CButtonST_demo\DlgAbout.cpp
?????文件????????895??2001-05-13?18:25??CButtonST_demo\DlgAbout.h
?????文件???????3777??2002-07-22?15:21??CButtonST_demo\DlgAdvanced.cpp
?????文件???????1248??2002-07-02?13:26??CButtonST_demo\DlgAdvanced.h
?????文件???????3806??2002-11-27?13:47??CButtonST_demo\DlgBasic.cpp
?????文件???????1175??2001-10-13?17:45??CButtonST_demo\DlgBasic.h
?????文件???????3044??2002-04-18?08:39??CButtonST_demo\DlgShadeButtonST.cpp
?????文件????????964??2001-06-14?18:47??CButtonST_demo\DlgShadeButtonST.h
?????文件???????2946??2002-11-27?13:53??CButtonST_demo\DlgTransparent.cpp
............此處省略84個文件信息
評論
共有 條評論