Click here to Skip to main content
14,269,202 members

ATL / WTL / STL

 
GeneralRe: CListBox with wchar or WCHAR Pin
Richard MacCutchan28-May-15 3:55
protectorRichard MacCutchan28-May-15 3:55 
GeneralRe: CListBox with wchar or WCHAR, Problem discovered Pin
bkelly1329-May-15 3:57
memberbkelly1329-May-15 3:57 
GeneralRe: CListBox with wchar or WCHAR, Problem discovered Pin
Richard MacCutchan29-May-15 4:33
protectorRichard MacCutchan29-May-15 4:33 
Questionis it true? fells he is boast, please somebody help me test . Pin
1971 powerChina7-May-15 15:19
member1971 powerChina7-May-15 15:19 
QuestionRe: is it true? fells he is boast, please somebody help me test . Pin
ZurdoDev18-May-15 4:54
professionalZurdoDev18-May-15 4:54 
QuestionServer execution failed in MFC COM Pin
Hydera29-Apr-15 23:59
memberHydera29-Apr-15 23:59 
AnswerRe: Server execution failed in MFC COM Pin
achal375418-May-15 22:00
memberachal375418-May-15 22:00 
QuestionCListViewCtrl HitTest problem Pin
ush_28-Apr-15 9:38
memberush_28-Apr-15 9:38 
As topic says, I'm having some HItTest issue.

Background:
I'm making a windows mobile ce 6.5 application.
There is some resource based dialog with ListView on it.
I'm subclassing the ListView with "CustomLVCtrl" and HeaderCtrl with "CustomHCtrl".
Both custom controls have increased height based on some constant value.

Now about my problem:
From WM_GESTURE GID_HOLD handler i'm getting some screen coordinates and then testing if any ListView item is being hold.
The problem is that i'm never getting a valid item index. It looks like item with index 0 is under the header, because testing first item results in 1, second returns 2, ..., then last returns -1. These results are not accurate for the whole item height either.

Simplified code:

void Controller::onHold(int x, int y)
{
	CPoint point(x, y);
	view_->list_.ScreenToClient(&point);
	LONG dlgBaseUnits = GetDialogBaseUnits();
	int baseunitX = LOWORD(dlgBaseUnits), baseunitY = HIWORD(dlgBaseUnits);
	point.x = ATL::MulDiv(point.x, 4, baseunitX);
	point.y = ATL::MulDiv(point.y, 8, baseunitY);
	LVHITTESTINFO lvhti;
	lvhti.flags = 0;
	lvhti.pt = point;
	int nItem = view_->list_.HitTest(&lvhti);
	if (lvhti.flags & LVHT_ONITEM)
	{
		ShowModal(nItem);
	}
}


I've also tried with
RECT rect={0,0,4,8};
MapDialogRect(hwnd, &rect);
int baseunitX = rect.right;
int baseunitY = rect.bottom;
point.x = ATL::MulDiv(point.x, 4, baseunitX);
point.y = ATL::MulDiv(point.y, 8, baseunitY);


but with same results. Can anyone point out what I'm doing wrong?
Questioncannot get text of __DATE__ (resolved) Pin
bkelly1322-Apr-15 9:24
memberbkelly1322-Apr-15 9:24 
AnswerRe: cannot get text of __DATE__ Pin
Richard MacCutchan22-Apr-15 23:19
protectorRichard MacCutchan22-Apr-15 23:19 
GeneralRe: cannot get text of __DATE__ Pin
bkelly1324-Apr-15 2:01
memberbkelly1324-Apr-15 2:01 
Questionfunction to delete a class (resolved) Pin
bkelly1321-Apr-15 3:42
memberbkelly1321-Apr-15 3:42 
AnswerRe: function to delete a class Pin
Richard MacCutchan21-Apr-15 21:11
protectorRichard MacCutchan21-Apr-15 21:11 
GeneralRe: function to delete a class Pin
bkelly1322-Apr-15 4:08
memberbkelly1322-Apr-15 4:08 
QuestionRe: function to delete a class Pin
Richard MacCutchan22-Apr-15 6:27
protectorRichard MacCutchan22-Apr-15 6:27 
AnswerRe: function to delete a class Pin
bkelly1322-Apr-15 9:15
memberbkelly1322-Apr-15 9:15 
GeneralRe: function to delete a class Pin
Richard MacCutchan22-Apr-15 22:27
protectorRichard MacCutchan22-Apr-15 22:27 
GeneralRe: function to delete a class Pin
bkelly1323-Apr-15 16:16
memberbkelly1323-Apr-15 16:16 
GeneralRe: function to delete a class Pin
Richard MacCutchan23-Apr-15 21:11
protectorRichard MacCutchan23-Apr-15 21:11 
GeneralRe: function to delete a class Pin
Richard MacCutchan22-Apr-15 23:15
protectorRichard MacCutchan22-Apr-15 23:15 
QuestionAlways on top (Task Manager) C# Pin
Rainsey Long25-Mar-15 5:45
memberRainsey Long25-Mar-15 5:45 
AnswerRe: Always on top (Task Manager) C# Pin
Richard MacCutchan25-Mar-15 6:33
protectorRichard MacCutchan25-Mar-15 6:33 
GeneralRe: Always on top (Task Manager) C# Pin
Rainsey Long25-Mar-15 7:01
memberRainsey Long25-Mar-15 7:01 
GeneralRe: Always on top (Task Manager) C# Pin
Richard MacCutchan25-Mar-15 7:58
protectorRichard MacCutchan25-Mar-15 7:58 
Questionwhere is WINVER set (resolved) Pin
bkelly1323-Mar-15 8:43
memberbkelly1323-Mar-15 8:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.