LAPTOP-SNT8I5JK\Boounion
2025-03-11 24e3d5124ed62ebd613ba883a366ea3461c9dd17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// 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_)