Click here to Skip to main content
15,891,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strings in EXE Pin
choramale_vs7-Sep-09 3:50
choramale_vs7-Sep-09 3:50 
GeneralRe: Strings in EXE Pin
Michael Schubert7-Sep-09 4:03
Michael Schubert7-Sep-09 4:03 
GeneralRe: Strings in EXE Pin
choramale_vs7-Sep-09 4:14
choramale_vs7-Sep-09 4:14 
GeneralRe: Strings in EXE Pin
Michael Schubert7-Sep-09 4:37
Michael Schubert7-Sep-09 4:37 
GeneralRe: Strings in EXE Pin
Nick_1117-Sep-09 6:17
Nick_1117-Sep-09 6:17 
GeneralRe: Strings in EXE Pin
Michael Schubert7-Sep-09 6:54
Michael Schubert7-Sep-09 6:54 
QuestionMySQL connection Pin
rdop7-Sep-09 1:16
rdop7-Sep-09 1:16 
QuestionTrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Le@rner7-Sep-09 1:07
Le@rner7-Sep-09 1:07 
Hi all,

i want to use Menu on right click of ListCtrl,

i m using this code
void CTest::OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR;

	UINT flags; 
    DWORD pos = GetMessagePos(); 
	
	CPoint point(LOWORD(pos), HIWORD(pos));

    m_List.ScreenToClient(&point); 
    int nItem = m_List.HitTest(point, &flags);

	
	HMENU hMenu = ::CreatePopupMenu();
	if (NULL != hMenu)
	{
		// add a few test items
		::AppendMenu(hMenu, MF_STRING,   1, "Test1");
		::AppendMenu(hMenu, MF_SEPARATOR,2,	"");
		::AppendMenu(hMenu, MF_STRING,   3, "Test2");
		::AppendMenu(hMenu, MF_SEPARATOR,4,	"");
		::AppendMenu(hMenu, MF_STRING,   5, "Test3");
		ClientToScreen(&point);

		int sel = ::TrackPopupMenuEx(hMenu,TPM_LEFTALIGN|TPM_RETURNCMD,point.x,point.y,m_hWnd,NULL);

		switch(sel)
		{
		case 1:
			{
				//do sumthing
			}
			break;

		case 3:
			{
				//do sumthing
			}
			break;

		case 5:
			{
				//do sumthing
			}

			break;
		
		}
	}

	*pResult = 0;
}
//-------------------------------------------------------------------------------------------------------------


its working fine only one problem is here its not popup the menu on tip of mouse cursor.

please tell me where i m wrong.

please help me .

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Richard MacCutchan7-Sep-09 2:20
mveRichard MacCutchan7-Sep-09 2:20 
GeneralRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Le@rner7-Sep-09 2:49
Le@rner7-Sep-09 2:49 
GeneralRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Richard MacCutchan7-Sep-09 4:16
mveRichard MacCutchan7-Sep-09 4:16 
GeneralRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Le@rner8-Sep-09 18:17
Le@rner8-Sep-09 18:17 
GeneralRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Richard MacCutchan8-Sep-09 22:59
mveRichard MacCutchan8-Sep-09 22:59 
GeneralRe: TrackPopupMenuEx not popup menu on rite cordinates in ListCtrl. Pin
Le@rner8-Sep-09 23:04
Le@rner8-Sep-09 23:04 
QuestionHow I will write a macro to check............................ Pin
deadlyabbas7-Sep-09 0:46
deadlyabbas7-Sep-09 0:46 
AnswerRe: How I will write a macro to check............................ Pin
Cedric Moonen7-Sep-09 0:55
Cedric Moonen7-Sep-09 0:55 
GeneralRe: How I will write a macro to check............................ Pin
deadlyabbas7-Sep-09 1:01
deadlyabbas7-Sep-09 1:01 
GeneralRe: How I will write a macro to check............................ Pin
Cedric Moonen7-Sep-09 1:18
Cedric Moonen7-Sep-09 1:18 
GeneralRe: How I will write a macro to check............................ Pin
deadlyabbas7-Sep-09 1:40
deadlyabbas7-Sep-09 1:40 
GeneralRe: How I will write a macro to check............................ Pin
Stuart Dootson7-Sep-09 2:55
professionalStuart Dootson7-Sep-09 2:55 
AnswerRe: How I will write a macro to check............................ Pin
Chris Losinger7-Sep-09 3:47
professionalChris Losinger7-Sep-09 3:47 
Questionvisual C++ expert...need help!! Pin
mr bard26-Sep-09 23:30
mr bard26-Sep-09 23:30 
AnswerRe: visual C++ expert...need help!! Pin
Cedric Moonen6-Sep-09 23:59
Cedric Moonen6-Sep-09 23:59 
GeneralRe: visual C++ expert...need help!! Pin
mr bard28-Sep-09 19:51
mr bard28-Sep-09 19:51 
AnswerRe: visual C++ expert...need help!! Pin
Richard MacCutchan8-Sep-09 23:03
mveRichard MacCutchan8-Sep-09 23:03 

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.