资源简介
可以方便地获取屏幕上任意点位置的颜色。RGB表示。
有额外需要(比如在窗口最下化情况下的读取颜色)的话可以自己改写代码。
不要分
代码片段和文件信息
#include “stdafx.h“
#include “BtnST.h“
#ifdef BTNST_USE_SOUND
#pragma comment(lib “winmm.lib“)
#include
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CButtonST
// Mask for control‘s type
#define BS_TYPEMASK SS_TYPEMASK
#ifndef TTM_SETtitle
#define TTM_SETtitleA (WM_USER + 32) // wParam = TTI_* lParam = char* sztitle
#define TTM_SETtitleW (WM_USER + 33) // wParam = TTI_* lParam = wchar* sztitle
#ifdef UNICODE
#define TTM_SETtitle TTM_SETtitleW
#else
#define TTM_SETtitle TTM_SETtitleA
#endif
#endif
#ifndef TTS_BALLOON
#define TTS_BALLOON 0x40
#endif
CButtonST::CButtonST()
{
m_bIsPressed = FALSE;
m_bIsFocused = FALSE;
m_bIsDisabled = FALSE;
m_bMouseOnButton = FALSE;
FreeResources(FALSE);
// Default type is “flat“ button
m_bIsFlat = TRUE;
// Button will be tracked also if when the window is inactive (like Internet Explorer)
m_bAlwaysTrack = TRUE;
// By default draw border in “flat“ button
m_bDrawBorder = TRUE;
// By default icon is aligned horizontally
m_byAlign = ST_ALIGN_HORIZ;
// By default use usual pressed style
SetPressedstyle(BTNST_PRESSED_LEFTRIGHT FALSE);
// By default for “flat“ button don‘t draw the focus rect
m_bDrawFlatFocus = FALSE;
// By default the button is not the default button
m_bIsDefault = FALSE;
// Invalid value since type still unknown
m_nTypestyle = BS_TYPEMASK;
// By default the button is not a checkbox
m_bIsCheckBox = FALSE;
m_nCheck = 0;
// Set default colors
SetDefaultColors(FALSE);
// No tooltip created
m_ToolTip.m_hWnd = NULL;
m_dwToolTipstyle = 0;
// Do not draw as a transparent button
m_bDrawTransparent = FALSE;
m_pbmpOldBk = NULL;
// No URL defined
SetURL(NULL);
// No cursor defined
m_hCursor = NULL;
// No associated menu
#ifndef BTNST_USE_BCMENU
m_hMenu = NULL;
#endif
m_hParentWndMenu = NULL;
m_bMenuDisplayed = FALSE;
m_bShowDisabledBitmap = TRUE;
m_ptImageOrg.x = 3;
m_ptImageOrg.y = 3;
// No defined callbacks
::ZeroMemory(&m_csCallbacks sizeof(m_csCallbacks));
#ifdef BTNST_USE_SOUND
// No defined sounds
::ZeroMemory(&m_csSounds sizeof(m_csSounds));
#endif
} // End of CButtonST
CButtonST::~CButtonST()
{
// Restore old bitmap (if any)
if (m_dcBk.m_hDC && m_pbmpOldBk)
{
m_dcBk.Selectobject(m_pbmpOldBk);
} // if
FreeResources();
// Destroy the cursor (if any)
if (m_hCursor) ::DestroyCursor(m_hCursor);
// Destroy the menu (if any)
#ifdef BTNST_USE_BCMENU
if (m_menuPopup.m_hMenu) m_menuPopup.DestroyMenu();
#else
if (m_hMenu) ::DestroyMenu(m_hMenu);
#endif
} // End of ~CButtonST
BEGIN_MESSAGE_MAP(CButtonST CButton)
//{{AFX_MSG_MAP(CButtonST)
ON_WM_SETCURSOR()
ON_WM_KILLFOCUS()
ON_WM_M
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 69988 2003-03-03 22:04 GetScreenPixel\GetScreenPixel\BtnST.cpp
文件 10405 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\BtnST.h
文件 1697 2012-08-05 20:35 GetScreenPixel\GetScreenPixel\ColorStatic.cpp
文件 686 2012-08-05 20:37 GetScreenPixel\GetScreenPixel\ColorStatic.h
文件 107636 2012-08-05 20:38 GetScreenPixel\GetScreenPixel\GetScreenPixel.aps
文件 2097 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\GetScreenPixel.cpp
文件 490 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\GetScreenPixel.h
文件 11512 2012-08-05 20:38 GetScreenPixel\GetScreenPixel\GetScreenPixel.rc
文件 6275 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\GetScreenPixel.vcxproj
文件 2678 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\GetScreenPixel.vcxproj.filters
文件 143 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\GetScreenPixel.vcxproj.user
文件 4356 2012-08-05 20:39 GetScreenPixel\GetScreenPixel\GetScreenPixelDlg.cpp
文件 975 2012-08-05 20:39 GetScreenPixel\GetScreenPixel\GetScreenPixelDlg.h
文件 1143 2012-07-23 10:13 GetScreenPixel\GetScreenPixel\PictureButton.cpp
文件 377 2012-07-23 10:13 GetScreenPixel\GetScreenPixel\PictureButton.h
文件 3146 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\ReadMe.txt
....... 67777 2009-08-31 02:31 GetScreenPixel\GetScreenPixel\res\GetScreenPixel.ico
文件 684 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\res\GetScreenPixel.rc2
文件 1254 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\res\li
文件 2198 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\resource.h
文件 147 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\stdafx.cpp
文件 1632 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\stdafx.h
文件 234 2012-08-05 19:33 GetScreenPixel\GetScreenPixel\targetver.h
文件 909 2012-08-05 19:33 GetScreenPixel\GetScreenPixel.sln
文件 107008 2012-08-05 20:39 GetScreenPixel\读取屏幕像素点颜色.exe
目录 0 2012-08-05 20:33 GetScreenPixel\GetScreenPixel\res
目录 0 2012-08-05 20:38 GetScreenPixel\GetScreenPixel
目录 0 2012-08-05 20:40 GetScreenPixel
----------- --------- ---------- ----- ----
405447 28
............此处省略1个文件信息
- 上一篇:修改Windows路由表源码
- 下一篇:windows串口控件
评论
共有 条评论