[CListCtrl]取得目前滑鼠所在位置的儲存格座標

目前是應用在CListCtrl::OnMouseMove()裡,用來取得目前滑鼠所在位置。

     const MSG* pMsg = this->GetCurrentMessage();  
if ( pMsg == NULL ) {
return; };
CPoint ptMsg = pMsg->pt; //Get point from the message
this->ScreenToClient(&ptMsg); //Convert the point's coords to be relative to this control
LVHITTESTINFO lvItemInfo;
lvItemInfo.pt = ptMsg;
int nItem = this->SubItemHitTest(&lvItemInfo); //Row Index - 0 base
int nSubItem = 3;//lvItemInfo.iSubItem; //Col Index - 0 base

No comments:

Post a Comment

Build docker image from multiple build contexts

Build docker image from multiple build contexts ...