Created
May 28, 2022 04:56
-
-
Save gekka/0459fadbbf980a63a4fde9dba98409d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CListCtrlEx | |
IMPLEMENT_DYNAMIC(CListCtrlEx, CListCtrl) | |
CListCtrlEx::CListCtrlEx() | |
{ | |
} | |
CListCtrlEx::~CListCtrlEx() | |
{ | |
} | |
BEGIN_MESSAGE_MAP(CListCtrlEx, CListCtrl) | |
ON_WM_LBUTTONDOWN() | |
END_MESSAGE_MAP() | |
// CListCtrlEx メッセージ ハンドラー | |
void CListCtrlEx::OnLButtonDown(UINT nFlags, CPoint point) | |
{ | |
// TODO: ここにメッセージ ハンドラー コードを追加するか、既定の処理を呼び出します。 | |
UINT flags; //HitTestでクリック座標に何があるのかを受け取る変数 | |
int item = this->HitTest(point, &flags); //クリック座標にあるアイテムのインデックスが返ってくる | |
if (flags & LVHT_NOWHERE) // item == -1 | |
{//何もないところなので何もさせない | |
return; | |
} | |
CListCtrl::OnLButtonDown(nFlags, point); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment