/****************************************************************************
* *
* GuiToolKit *
* (MFC extension) *
* Created by Francisco Campos G. www.beyondata.com fcampos@beyondata.com *
*--------------------------------------------------------------------------*
* *
* This program is free software;so you are free to use it any of your *
* applications (Freeware, Shareware, Commercial),but leave this header *
* intact. *
* *
* These files are provided "as is" without warranty of any kind. *
* *
* GuiToolKit is forever FREE CODE !!!!! *
* *
*--------------------------------------------------------------------------*
* Bug Fixes and improvements : (Add your name) *
* -Francisco Campos *
* *
****************************************************************************/
//------------------------------------------------------------------------------
// File : NewMenu.cpp
// Version : 1.0
// Date : Mai 2002
// Author : Bruno Podetti
// Email : Podetti@gmx.net
// Systems : VC6.0 and VC7.0 (Run under (Window 98/ME), Windows Nt 2000/XP)
//
// Bug Fixes and portions of code from previous version supplied by:
//
// Brent Corkum, Ben Ashley, Girish Bharadwaj, Jean-Edouard Lachand-Robert,
// Robert Edward Caldecott, Kenny Goers, Leonardo Zide, Stefan Kuhr,
// Reiner Jung, Martin Vladic, Kim Yoo Chul, Oz Solomonovich, Tongzhe Cui,
// Stephane Clog, Warren Stevens, Damir Valiulin
//
// 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 (Freeware, Shareware, Commercial).
// 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 "..\header\NewMenu.h" // CNewMenu class declaration
#include "..\header\GuiDrawLayer.h"
#include "..\header\MenuBar.h"
//#define _TRACE_MENU_
#ifdef _TRACE_MENU_
#include "MyTrace.h"
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#endif
#ifndef IS_INTRESOURCE
#define IS_INTRESOURCE(hh) (HIWORD(hh)==NULL)
#endif
#define GAP 2
#ifndef ODS_HOTLIGHT
#define ODS_HOTLIGHT 0x0040
#endif
#ifndef ODS_INACTIVE
#define ODS_INACTIVE 0x0080
#endif
#ifndef COLOR_MENUBAR
#define COLOR_MENUBAR 30
#endif
#ifndef SPI_GETDROPSHADOW
#define SPI_GETDROPSHADOW 0x1024
#endif
#ifndef SPI_GETFLATMENU
#define SPI_GETFLATMENU 0x1022
#endif
extern int gbintHorz; //Horz=0, Vert=1
extern CRect rcMenu; //CRect of button
/////////////////////////////////////////////////////////////////////////////
#include "..\header\GuiDrawLayer.h"
// Helpers for casting
__inline HMENU UIntToHMenu(const unsigned int ui )
{
return( (HMENU)(UINT_PTR)ui );
}
__inline HMENU HWndToHmenu(const HWND hwnd )
{
return( (HMENU)hwnd );
}
__inline UINT HWndToUInt(const HWND hWnd )
{
return( (UINT)(UINT_PTR) hWnd);
}
__inline HWND UIntToHWnd(const UINT hWnd )
{
return( (HWND)(UINT_PTR) hWnd);
}
__inline UINT HMenuToUInt(const HMENU hMenu )
{
return( (UINT)(UINT_PTR) hMenu);
}
//static CMenuBar* pBar=CNewMenu::m_pBar;
CMenuButton* pb;
static void ShowLastError()
{
DWORD error = GetLastError();
if(error)
{
LPVOID lpMsgBuf=NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL );
if(lpMsgBuf)
{
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
// Free the buffer.
LocalFree( lpMsgBuf );
}
else
{
CString temp;
temp.Format(_T("Error message 0x%lx not found"),error);
// Display the string.
MessageBox( NULL,temp, _T("Error"), MB_OK | MB_ICONINFORMATION );
}
}
}
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)
{
ZeroMemory(osvi,sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
if(!GetVersionEx(osvi))
{
ShowLastError();
}
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(osvi,0,sizeof(OSVERSIONINFO));
osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(osvi);
if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==10L)
{
ShellType=Win98;
}
else if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==90L)
{
ShellType=WinME;
}
free(osvi);
}
}
return ShellType;
}
BOOL IsShadowEnabled()
{
BOOL bEnabled=FALSE;
if(SystemParametersInfo(SPI_GETDROPSHADOW,0,&bEnabled,0))
{
return bEnabled;
}
return FALSE;
}
COLORREF DarkenColorXP(COLORREF ColA)
{
return RGB( MulDiv(GetRValue(ColA),7,10),
MulDiv(GetGValue(ColA),7,10),
MulDiv(GetBValue(ColA)+55,7,10));
}
// Function splits a color into its RGB components and
// transforms the color using a scale 0..255
COLORREF DarkenColor( long lScale, COLORREF lColor)
{
long R = MulDiv(GetRValue(lColor),(255-lScale),255);
long G = MulDiv(GetGValue(lColor),(255-lScale),255);
long B = MulDiv(GetBValue(lColor),(255-lScale),255);
return RGB(R, G, B);
}
COLORREF MixedColor(COLORREF ColA,COLORREF ColB)
{
// ( 86a + 14b ) / 100
int Red = MulDiv(86,GetRValue(ColA),100) + MulDiv(14,GetRValue(ColB),100);
int Green = MulDiv(86,GetGValue(ColA),100) + MulDiv(14,GetGValue(ColB),100);
int Blue = MulDiv(86,GetBValue(ColA),100) + MulDiv(14,GetBValue(ColB),100);
return RGB( Red,Green,Blue);
}
COLORREF MidColor(COLORREF ColA,COLORREF ColB)
{
// (7a + 3b)/10
int Red = MulDiv(7,GetRValue(ColA),10) + MulDiv(3,GetRValue(ColB),10);
int Green = MulDiv(7,GetGValue(ColA),10) + MulDiv(3,GetGValue(ColB),10);
int Blue = MulDiv(7,GetBValue(ColA),10) + MulDiv(3,GetBValue(ColB),10);
return RGB( Red,Green,Blue);
}
// used for function gradientfill.
//#pragma comment(lib,"Msimg32.lib")
void DrawGradient(CDC* pDC,CRect& Rect,
COLORREF StartColor,COLORREF EndColor,
BOOL bHorizontal)
{
/*TRIVERTEX vert[2] ;
GRADIENT_RECT gRect;
vert [0].y = Rect.top;
vert [0].x = Rect.left;
vert [0].Red = COLOR16(COLOR16(Ge
没有合适的资源?快使用搜索试试~ 我知道了~
一个功能较强且界面漂亮的串口监视软件
共208个文件
h:86个
cpp:84个
bmp:16个
需积分: 9 14 下载量 101 浏览量
2009-02-26
11:56:30
上传
评论
收藏 1014KB RAR 举报
温馨提示
一个功能较强且界面漂亮的串口监视软件,窗口界面设置了很多功能,不同与以往功能较少的监视界面
资源推荐
资源详情
资源评论
收起资源包目录
一个功能较强且界面漂亮的串口监视软件 (208个子文件)
SCC.APS 74KB
toolbar_.bmp 2KB
toolbar1.bmp 2KB
Toolbar.bmp 1KB
DockOffice.bmp 1KB
DockOffice.bmp 1KB
scc_tool.bmp 1KB
bitmap1.bmp 622B
bitmap1.bmp 622B
bitradio.bmp 454B
bitmap4.bmp 454B
bmp00001.bmp 294B
bmp00001.bmp 294B
bmp00002.bmp 206B
bmp00002.bmp 206B
bitmap2.bmp 198B
bitmap3.bmp 190B
SCC.clw 9KB
NewMenu.cpp 121KB
MenuBar.cpp 93KB
GuiControlBar.cpp 41KB
GuiToolBarWnd.cpp 37KB
CoolMenu.cpp 36KB
MainFrm.cpp 31KB
SerialPort.cpp 30KB
GuiADODB.cpp 26KB
GuiButton.cpp 24KB
GuiDockContext.cpp 21KB
GuiOfficeBar.cpp 18KB
XRichEditCtrl.cpp 16KB
GuiTabWnd.cpp 16KB
GuiWorkTab.cpp 14KB
CGuiEditView.cpp 14KB
GuiEditView.cpp 14KB
GuiRadioButton.cpp 14KB
GuiMiniFrameWnd.cpp 13KB
GuiFolder.cpp 13KB
GuiMiniTool.cpp 12KB
GuiSliderCtrl.cpp 12KB
GuiMiniFrame.cpp 12KB
GuiComboBoxExt.cpp 12KB
GuiEdit.cpp 11KB
GuiDrawLayer.cpp 11KB
GuiComboFont.cpp 10KB
GuiMDIFrame.cpp 10KB
ListCtrlEx.cpp 10KB
GuiHeaderCtrl.cpp 10KB
XRichEditView.cpp 10KB
GuiContainer.cpp 10KB
GuiOutLook.cpp 9KB
GuicheckBox.cpp 9KB
scbarg.cpp 9KB
GuiTabPowerPoint.cpp 9KB
Subclass.cpp 8KB
GuiFrameWnd.cpp 8KB
GuiTabbed.cpp 8KB
DlgSend.cpp 8KB
GuiDocBarExten.cpp 8KB
GuiSplitter.cpp 8KB
GuiToolButton.cpp 7KB
GuiListEdit.cpp 7KB
GuiMiniSplitter.cpp 6KB
GuiLinkButton.cpp 6KB
GuiWorkPanel.cpp 6KB
DirectoryDialog.cpp 6KB
GuiPanelAccess.cpp 6KB
SCC.cpp 5KB
GuiCapOutBar.cpp 5KB
GuiSysTray.cpp 5KB
GuiGroupBox.cpp 5KB
GuiVisioFolder.cpp 4KB
GuiDropDownEdit.cpp 4KB
GuiImageLinkButton.cpp 4KB
DlgFilter.cpp 4KB
GuiMDITabbed.cpp 4KB
GuiStatusBar.cpp 4KB
GuiSplitterWnd.cpp 4KB
GuiDocSpecial.cpp 3KB
GuiDockToolBar.cpp 3KB
GuiNormalButton.cpp 3KB
GuiFile.cpp 3KB
GuiGridLayout.cpp 3KB
SCCSendEdit.cpp 3KB
GuiFDir.cpp 3KB
GuiView.cpp 3KB
GuiFolderFlat.cpp 3KB
GuiLabelButton.cpp 2KB
GuiOutLookView.cpp 2KB
GuiButtonTimer.cpp 2KB
StatLink.cpp 2KB
GuiLib.cpp 2KB
GuiPowerPointView.cpp 2KB
GuiStaticStandar.cpp 2KB
CheckSum.cpp 2KB
Transmit.cpp 2KB
GuiViewWorkTab.cpp 2KB
SendFrameWnd.cpp 2KB
DlgAutoSave.cpp 1KB
SCCView.cpp 1KB
GuiDockBar.cpp 676B
共 208 条
- 1
- 2
- 3
资源评论
magiceon
- 粉丝: 2
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功