Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Web Services Pin
Christian Graus28-May-03 12:02
protectorChristian Graus28-May-03 12:02 
GeneralRe: Web Services Pin
Nemanja Trifunovic28-May-03 12:23
Nemanja Trifunovic28-May-03 12:23 
GeneralRe: Web Services Pin
Jason Henderson28-May-03 17:31
Jason Henderson28-May-03 17:31 
Questionwhich function can capture mouse and cursor events? Pin
includeh1028-May-03 10:53
includeh1028-May-03 10:53 
AnswerRe: which function can capture mouse and cursor events? Pin
David Crow28-May-03 11:01
David Crow28-May-03 11:01 
QuestionAdding a button to the system bar? Pin
mcgahanfl28-May-03 10:51
mcgahanfl28-May-03 10:51 
AnswerRe: Adding a button to the system bar? Pin
Rickard Andersson2028-May-03 11:59
Rickard Andersson2028-May-03 11:59 
GeneralMenu :o) Pin
MemLeak28-May-03 10:13
MemLeak28-May-03 10:13 
Hi,

I have a DlgApp that launch other applications. When the user click on a button, a popup menu is created with some data that I have collected in my database. The user then need to select an item into the menu. The selected info is used as parameters to launch the other app.

This is my click button handler:

void CmyDlg::OnBnClickedBtnDbmanager()
{
CMenu myMenu;

CRect rect;
m_wndDBBtn.GetWindowRect(&rect);

monMenu.CreatePopupMenu();
monMenu.AppendMenu(MF_STRING, 0, "Name1");
monMenu.AppendMenu(MF_STRING, 0, "Name2");
monMenu.AppendMenu(MF_STRING, 0, "Name3");
monMenu.AppendMenu(MF_STRING, 0, "Name4");

myMenu.TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON, rect.left+20, rect.top+20, AfxGetMainWnd());
}

I would like to know how I can get the index of the menu. For example, if I select name4 into the menu, I would like something to tell me that the fourth item is selected... After that, I can use GetMenuString() to retrieve my data and launch my other App.

As you can see, unstead of ID as second parameter into AppendMenu() I have 0. The reason of this is that I dont know how many info I will have to put into my menu, so i can't provide ID for each of them.

Any Ideas?


Everything's beautiful if you look at it long enough...
GeneralRe: Menu :o) Pin
peterchen28-May-03 10:46
peterchen28-May-03 10:46 
GeneralRe: Menu :o) Pin
Michael Dunn28-May-03 15:58
sitebuilderMichael Dunn28-May-03 15:58 
QuestionProblem with fprintf ? Pin
iltallman28-May-03 9:32
iltallman28-May-03 9:32 
AnswerRe: Problem with fprintf ? Pin
Nick Parker28-May-03 10:00
protectorNick Parker28-May-03 10:00 
GeneralRe: Problem with fprintf ? Pin
iltallman28-May-03 10:26
iltallman28-May-03 10:26 
GeneralRe: Problem with fprintf ? Pin
Peter Weyzen28-May-03 11:05
Peter Weyzen28-May-03 11:05 
AnswerRe: Problem with fprintf ? Pin
Peter Weyzen28-May-03 10:28
Peter Weyzen28-May-03 10:28 
GeneralRe: Problem with fprintf ? Pin
Robert Little28-May-03 10:45
Robert Little28-May-03 10:45 
GeneralRe: Problem with fprintf ? Pin
David Crow28-May-03 11:00
David Crow28-May-03 11:00 
GeneralRe: Problem with fprintf ? Pin
Peter Weyzen28-May-03 11:03
Peter Weyzen28-May-03 11:03 
AnswerRe: Problem with fprintf ? Pin
Trollslayer28-May-03 22:16
mentorTrollslayer28-May-03 22:16 
QuestionHow do you use Doc/View architecture with ActiveX controls? Pin
kleft28-May-03 8:04
kleft28-May-03 8:04 
QuestionFloating menu?? Pin
MemLeak28-May-03 8:00
MemLeak28-May-03 8:00 
AnswerRe: Floating menu?? Pin
basementman28-May-03 8:01
basementman28-May-03 8:01 
AnswerRe: Floating menu?? Pin
Joan M28-May-03 21:15
professionalJoan M28-May-03 21:15 
Questionhow to resize an application depending on the display settings Pin
johnstonsk28-May-03 7:44
johnstonsk28-May-03 7:44 
AnswerRe: how to resize an application depending on the display settings Pin
basementman28-May-03 8:05
basementman28-May-03 8:05 

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.