Click here to Skip to main content
15,893,663 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: mouse position in treeview Pin
Nibu babu thomas14-Jun-06 17:54
Nibu babu thomas14-Jun-06 17:54 
GeneralRe: mouse position in treeview Pin
Naveen14-Jun-06 18:02
Naveen14-Jun-06 18:02 
GeneralRe: mouse position in treeview Pin
Nibu babu thomas14-Jun-06 18:07
Nibu babu thomas14-Jun-06 18:07 
GeneralRe: mouse position in treeview Pin
zeus_master14-Jun-06 17:56
zeus_master14-Jun-06 17:56 
GeneralRe: mouse position in treeview Pin
Naveen14-Jun-06 18:12
Naveen14-Jun-06 18:12 
QuestionRe: mouse position in treeview [modified] Pin
zeus_master14-Jun-06 20:36
zeus_master14-Jun-06 20:36 
AnswerRe: mouse position in treeview Pin
Naveen14-Jun-06 22:15
Naveen14-Jun-06 22:15 
QuestionRe: mouse position in treeview Pin
zeus_master15-Jun-06 0:05
zeus_master15-Jun-06 0:05 
void CMainFrame::OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here

CMenu dMenu;
if(!dMenu.LoadMenu(IDR_TREERKEY))
{
AfxThrowResourceException();
}
CMenu *pPopupMenu = dMenu.GetSubMenu(0);
ASSERT(pPopupMenu != NULL);
CPoint point;

::GetCursorPos(&point); /* here the point still stay at where LClick set sel */
// const MSG * pMsg;
// pMsg = GetCurrentMessage();
// point = pMsg->pt;
HTREEITEM pitem;
pitem=m_Tree.HitTest(point);
m_Tree.SetItemState(pitem,TVIS_SELECTED,NULL);


pPopupMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON,point.x,point.y,AfxGetMainWnd());

*pResult = 0;
}



I faild, set breakpoint and found that, the point still keep on the place where LClick set sel tree item, and the RClick at another item seems can't return mouse point at once. but what strangeness is the pop-menu can appear at where the RClick point/item.
is the code wrong?


appreciate for your kindly help.
AnswerRe: mouse position in treeview Pin
Naveen15-Jun-06 1:14
Naveen15-Jun-06 1:14 
GeneralRe: mouse position in treeview Pin
zeus_master15-Jun-06 16:52
zeus_master15-Jun-06 16:52 
QuestionCTabCtrl in MDI splitter won't compile Pin
Vaclav14-Jun-06 15:52
Vaclav14-Jun-06 15:52 
AnswerRe: CTabCtrl in MDI splitter won't compile Pin
Vaclav14-Jun-06 16:58
Vaclav14-Jun-06 16:58 
GeneralRe: CTabCtrl in MDI splitter won't compile Pin
Ryan Binns14-Jun-06 18:53
Ryan Binns14-Jun-06 18:53 
QuestionMenu items missing in shell context menu... Pin
nm_11414-Jun-06 15:13
nm_11414-Jun-06 15:13 
QuestionMFC Publications Pin
sidkraft14-Jun-06 14:13
sidkraft14-Jun-06 14:13 
AnswerRe: MFC Publications Pin
Vaclav14-Jun-06 16:12
Vaclav14-Jun-06 16:12 
Questionusing mci Pin
locoone14-Jun-06 13:28
locoone14-Jun-06 13:28 
AnswerRe: using mci Pin
Hamid_RT14-Jun-06 19:21
Hamid_RT14-Jun-06 19:21 
GeneralRe: using mci [modified] Pin
locoone15-Jun-06 12:10
locoone15-Jun-06 12:10 
GeneralRe: using mci Pin
Hamid_RT15-Jun-06 20:09
Hamid_RT15-Jun-06 20:09 
GeneralRe: using mci [modified] Pin
locoone16-Jun-06 11:50
locoone16-Jun-06 11:50 
GeneralRe: using mci Pin
Hamid_RT16-Jun-06 19:10
Hamid_RT16-Jun-06 19:10 
GeneralRe: using mci Pin
locoone16-Jun-06 23:19
locoone16-Jun-06 23:19 
QuestionSetupDiEnumDeviceInterfaces() Pin
kitty514-Jun-06 11:04
kitty514-Jun-06 11:04 
AnswerRe: SetupDiEnumDeviceInterfaces() Pin
Jörgen Sigvardsson14-Jun-06 11:41
Jörgen Sigvardsson14-Jun-06 11:41 

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.