Click here to Skip to main content
15,915,000 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem about variable scope Pin
cmk7-Apr-05 19:45
cmk7-Apr-05 19:45 
GeneralRe: problem about variable scope Pin
Michael Dunn7-Apr-05 20:28
sitebuilderMichael Dunn7-Apr-05 20:28 
GeneralRe: problem about variable scope Pin
S. Senthil Kumar7-Apr-05 21:58
S. Senthil Kumar7-Apr-05 21:58 
Questionhow to check if a reference is NULL Pin
ng kok chuan7-Apr-05 17:07
ng kok chuan7-Apr-05 17:07 
AnswerRe: how to check if a reference is NULL Pin
Ryan Binns7-Apr-05 18:14
Ryan Binns7-Apr-05 18:14 
GeneralRe: how to check if a reference is NULL Pin
ng kok chuan7-Apr-05 20:50
ng kok chuan7-Apr-05 20:50 
GeneralRe: how to check if a reference is NULL Pin
S. Senthil Kumar7-Apr-05 22:13
S. Senthil Kumar7-Apr-05 22:13 
QuestionHow to HitTest an item of a List Ctrl owned by another thread Pin
Luckybird7-Apr-05 16:23
Luckybird7-Apr-05 16:23 
I succeeded in obtaining a CListCtrl item info using HitTest() when the List Ctrl is owned by my current thread. But when I tried HitTest an item of a List Ctrl owned by other threads such as Explorer folder view, I failed. My code is as follows:

// current cursor pos
CPoint pt;

// Suppose pWnd is the window owned by another thread
CListView* pListView = static_cast<CListView*>(pWnd);

// Get the reference of List Ctrl
CListCtrl& listCtrl = pListView->GetListCtrl();

if(listCtrl.GetItemCount() != 0)
{
::GetCursorPos(&pt);

// Get the client pos for HitTest
pListView->ScreenToClient(&pt);

LVHITTESTINFO lvhti;
lvhti.pt = pt;

// Now do HitTest() to get the item at current cursor pos
int nItem = listCtrl.HitTest(&lvhti);

if(nItem != -1)
{
...
}

...
}

The nItem always equals to -1 even when mouse is on the list ctrl item, which indicates that the HitTest() fails.

I also tried SubItemHitTest() and even AttachThreadInput() but all seem doesn't work.

Can anyone help me solve the problem? Thanks.
AnswerRe: How to HitTest an item of a List Ctrl owned by another thread Pin
Ryan Binns7-Apr-05 18:18
Ryan Binns7-Apr-05 18:18 
GeneralRe: How to HitTest an item of a List Ctrl owned by another thread Pin
Luckybird7-Apr-05 23:29
Luckybird7-Apr-05 23:29 
GeneralRe: How to HitTest an item of a List Ctrl owned by another thread Pin
Ryan Binns8-Apr-05 2:12
Ryan Binns8-Apr-05 2:12 
Generalpliz help me with input validation Pin
mpapeo7-Apr-05 15:05
mpapeo7-Apr-05 15:05 
GeneralRe: pliz help me with input validation Pin
Christian Graus7-Apr-05 15:14
protectorChristian Graus7-Apr-05 15:14 
GeneralRe: pliz help me with input validation Pin
Anonymous7-Apr-05 15:35
Anonymous7-Apr-05 15:35 
GeneralRe: pliz help me with input validation Pin
Christian Graus7-Apr-05 15:39
protectorChristian Graus7-Apr-05 15:39 
GeneralRe: pliz help me with input validation Pin
mpapeo7-Apr-05 15:50
mpapeo7-Apr-05 15:50 
GeneralRe: pliz help me with input validation Pin
Christian Graus7-Apr-05 15:52
protectorChristian Graus7-Apr-05 15:52 
GeneralRe: pliz help me with input validation Pin
mpapeo8-Apr-05 1:48
mpapeo8-Apr-05 1:48 
GeneralRe: pliz help me with input validation Pin
David Crow8-Apr-05 5:29
David Crow8-Apr-05 5:29 
GeneralRe: pliz help me with input validation Pin
LighthouseJ7-Apr-05 15:48
LighthouseJ7-Apr-05 15:48 
GeneralRe: pliz help me with input validation Pin
mpapeo7-Apr-05 15:59
mpapeo7-Apr-05 15:59 
GeneralRe: pliz help me with input validation Pin
mpapeo7-Apr-05 16:21
mpapeo7-Apr-05 16:21 
Generalemulating commands in c++ Pin
Jeb997-Apr-05 14:32
Jeb997-Apr-05 14:32 
GeneralRe: emulating commands in c++ Pin
Christian Graus7-Apr-05 15:14
protectorChristian Graus7-Apr-05 15:14 
QuestionWhere to download a crystal report tool from? Pin
awasthy7-Apr-05 13:52
awasthy7-Apr-05 13:52 

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.