void CMenuBtnDlg::OnMenubutton()
{
CMenu menu, *pPopup;
DWORD SelectionMade;
menu.LoadMenu(IDR_MENU);
pPopup = menu.GetSubMenu(0);
RECT pp;
CWnd *pWnd = GetDlgItem(IDC_MENUBUTTON);
pWnd->GetWindowRect(&pp);
SelectionMade = pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON,pp.right,pp.top,this);
pPopup->DestroyMenu();
}
{
CMenu menu, *pPopup;
DWORD SelectionMade;
menu.LoadMenu(IDR_MENU);
pPopup = menu.GetSubMenu(0);
RECT pp;
CWnd *pWnd = GetDlgItem(IDC_MENUBUTTON);
pWnd->GetWindowRect(&pp);
SelectionMade = pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON,pp.right,pp.top,this);
pPopup->DestroyMenu();
}
'Windows > MFC' 카테고리의 다른 글
탐색기에서 Drag & Drop 을 받기 (0) | 2013.10.02 |
---|---|
Environments information path (registry) (0) | 2013.10.02 |
global memory CreateFileMapping MapViewOfFile (0) | 2013.10.02 |
Displaying the Installed Devices (0) | 2013.10.02 |
Creating named shared Memory (0) | 2013.10.02 |