// HorizontalLine.h: interface for the CHorizontalLine class.
|
//
|
//////////////////////////////////////////////////////////////////////
|
|
#if !defined(AFX_HORIZONTALLINE_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_)
|
#define AFX_HORIZONTALLINE_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_
|
|
|
#pragma comment(lib, "Msimg32.lib") // TransparentBlt
|
|
|
|
//====== HorizontalLine =====================================================
|
|
#ifndef NOHORIZONTALLINE
|
|
#ifdef _WIN32
|
|
#define BYHORIZONTALLINE_CLASSA "BYHorizontalLine"
|
#define BYHORIZONTALLINE_CLASSW L"BYHorizontalLine"
|
|
#ifdef UNICODE
|
#define BYHORIZONTALLINE_CLASS BYHORIZONTALLINE_CLASSW
|
#else
|
#define BYHORIZONTALLINE_CLASS BYHORIZONTALLINE_CLASSA
|
#endif
|
|
#else
|
#define BYHORIZONTALLINE_CLASS "BYHorizontalLine"
|
#endif
|
|
|
#define BYSTAG_HORIZONTALLINE _T("ISHORIZONTALLINE")
|
|
|
//====== WM_NOTIFY codes (NMHDR.code values) ==================================
|
#define BYHORIZONTALLINE_FIRST (0U-590U) //
|
#define BYHORIZONTALLINE_LAST (0U-550U)
|
#define BYHORIZONTALLINE_ (BYHORIZONTALLINE_FIRST - 1)
|
|
|
typedef struct tagBYHORIZONTALLINE_NMHDR
|
{
|
NMHDR nmhdr;
|
DWORD dwData;
|
DWORD dwData1;
|
DWORD dwData2;
|
} BYHORIZONTALLINE_NMHDR;
|
|
|
|
#endif
|
|
|
|
|
#if _MSC_VER > 1000
|
#pragma once
|
#endif // _MSC_VER > 1000
|
|
|
class CHorizontalLine
|
{
|
public:
|
CHorizontalLine();
|
virtual ~CHorizontalLine();
|
|
public:
|
static BOOL RegisterWndClass();
|
static CHorizontalLine* Hook(HWND hWnd);
|
void Notify(int nCode, int dwData, int dwData1 = 0, int dwData2 = 0);
|
void Release();
|
void SetBkgndColor(COLORREF cr);
|
void SetLineColor(COLORREF cr);
|
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
static LRESULT OnNcCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
LRESULT OnDestroy(WPARAM wParam, LPARAM lParam);
|
LRESULT OnTimer(WPARAM wParam, LPARAM lParam);
|
LRESULT OnPaint(WPARAM wParam, LPARAM lParam);
|
|
private:
|
HWND m_hWnd;
|
COLORREF m_crBkgnd;
|
COLORREF m_crLineColor;
|
};
|
|
#endif // !defined(AFX_HORIZONTALLINE_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_)
|