기본카테고리

[C++]Popup Menu 만들기

DevAdd 2011. 2. 24. 23:53




HMENU menu;
POINT pt;
menu = CreatePopupMenu();
SetForegroundWindow( hDlg );
GetCursorPos( &pt );
int i = 19;

HBITMAP bm = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TEST));
AppendMenu(menu, MF_BITMAP, i++, (LPCTSTR)bm);//LoadIcon(hInst, MAKEINTRESOURCE(IDI_TEST)));//_TEXT("meh meh") );
AppendMenu( menu, MF_BITMAP, i++, (LPCTSTR)bm);//_TEXT("testo") );
AppendMenu( menu, MF_BITMAP, i++, (LPCTSTR)bm);//_TEXT("foobar foobar") );
AppendMenu( menu, MF_BITMAP|MF_MENUBREAK, i++, (LPCTSTR)bm);//_TEXT("foobar foobar") );
AppendMenu( menu, MF_BITMAP, i++, (LPCTSTR)bm);//_TEXT("foobar foobar") );
AppendMenu( menu, MF_BITMAP, i++, (LPCTSTR)bm);//_TEXT("foobar foobar") );
TrackPopupMenuEx( menu, 0, pt.x, pt.y, hDlg, NULL );
DestroyMenu( menu );