Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a popup menu, using SDK

Status
Not open for further replies.

Dominus

Programmer
Nov 24, 2000
9
BR
How to create a popup menu from the status area of the windows task bar, using SDK.
 
Create with tthe Wizard ON_WM_CONTEXTMENU.

then

if( -1 == point.x && -1 == point.y ) {
// Context Menu Button on Keyboard pressed
}
else {
// set Selection to where the mouse points
}

// Depending the Position on screen load different popups
CMenu menu.LoadMenu(IDR_CONTEXT_APP);
 
Sorry I've something forgotten:

CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
pPopup->TrackPopupMenu(TPM_RIGHTBUTTON | TPM_LEFTALIGN,
point.x, point.y,
AfxGetMainWnd()); // route commands through main window
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top