当前位置: 首页>>代码示例>>C++>>正文


C++ RemoveMenu函数代码示例

本文整理汇总了C++中RemoveMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ RemoveMenu函数的具体用法?C++ RemoveMenu怎么用?C++ RemoveMenu使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RemoveMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteTrace

void CMainMenu::ResetMenu(void) 
{
	WriteTrace(TraceDebug,__FUNCTION__ ": Start");
	if (!g_Settings->LoadBool(UserInterface_InFullScreen))
	{
		//Create a new window with all the items
		WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu");
		HMENU hMenu = (HMENU)CreateMenu();
		FillOutMenu(hMenu);
		WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu Done");

		//save old menu to destroy latter
		HMENU OldMenuHandle;
		{
			CGuard Guard(m_CS);
			OldMenuHandle = m_MenuHandle;

			//save handle and re-attach to a window
			WriteTrace(TraceDebug,__FUNCTION__ ": Attach Menu");
			m_MenuHandle = hMenu;
		}
		_Gui->SetWindowMenu(this);

		WriteTrace(TraceDebug,__FUNCTION__ ": Remove plugin menu");
		if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu()))
		{
			RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND); 
		}
		if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu()))
		{
			RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND); 
		}
		WriteTrace(TraceDebug,__FUNCTION__ ": Destroy Old Menu");

		//Destroy the old menu
		DestroyMenu((HMENU)OldMenuHandle); 
	}

	ResetAccelerators();

	WriteTrace(TraceDebug,__FUNCTION__ ": Done");
}
开发者ID:Anonymous2,项目名称:project64,代码行数:42,代码来源:Main+Menu+Class.cpp

示例2: RemoveMenu

void
JXMenuBar::DeleteMenu
	(
	const JIndex index
	)
{
	JXMenu* theMenu = RemoveMenu(index);
	assert( theMenu->itsOwner == NULL );
	theMenu->itsMenuBar = NULL;
	delete theMenu;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:11,代码来源:JXMenuBar.cpp

示例3: LanguageExit

/*
 * LanguageExit:  Free language menu when game exited.
 */
void LanguageExit(void)
{
   // Remove "Language" menu.
   if (language_menu != NULL)
   {
      RemoveMenu(cinfo->main_menu, MENU_POSITION_LANGUAGE, MF_BYPOSITION);
      DrawMenuBar(cinfo->hMain);
      DestroyMenu(language_menu);
   }

   language_menu = NULL;
}
开发者ID:GarOfMeridian,项目名称:Meridian59_103,代码行数:15,代码来源:language.c

示例4: DestroyTrayMenu

void DestroyTrayMenu(HMENU hMenu)
{
	int i, cnt;

	cnt = GetMenuItemCount(hMenu);
	for (i = 0; i < cnt; ++i) {
		HMENU hSubMenu = GetSubMenu(hMenu, i);
		if (hSubMenu == hMainStatusMenu || hSubMenu == hMainMenu)
			RemoveMenu(hMenu, i--, MF_BYPOSITION);
	}
	DestroyMenu(hMenu);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:12,代码来源:clistmenus.cpp

示例5: while

OMenu::~OMenu() {
	if (::IsMenu(m_hMenu)) {
		while(GetMenuItemCount() != 0)
			RemoveMenu(0, MF_BYPOSITION);
	} else {
		// How can we end up here??? it sure happens sometimes..
		for (OMenuItem::Iter i = items.begin(); i != items.end(); ++i) {
			delete *i;
		}
	}
	//pUnMap();
}
开发者ID:strogo,项目名称:StrongDC,代码行数:12,代码来源:OMenu.cpp

示例6: MrEdSchemeMessages

static void MrEdSchemeMessages(char *msg, ...)
{
  GC_CAN_IGNORE va_list args;
  
  scheme_start_atomic();

  XFORM_HIDE_EXPR(va_start(args, msg));

  if (!console_out) {
    AllocConsole();
    console_out = GetStdHandle(STD_OUTPUT_HANDLE);

    if (!wx_in_terminal) {
      has_stdio = 1;
      waiting_sema = CreateSemaphore(NULL, 0, 1, NULL);
      orig_signal_handle = scheme_get_signal_handle();
      orig_break_handle = scheme_get_main_thread_break_handle();
      SetConsoleCtrlHandler(ConsoleHandler, TRUE);      

      {
	HMODULE hm;
	gcw_proc gcw;

	hm = LoadLibrary("kernel32.dll");
	if (hm)
	  gcw = (gcw_proc)GetProcAddress(hm, "GetConsoleWindow");
	else
	  gcw = NULL;
    
	if (gcw)
	  console_hwnd = gcw();
      }

      if (console_hwnd) {
	EnableMenuItem(GetSystemMenu(console_hwnd, FALSE), SC_CLOSE,
		       MF_BYCOMMAND | MF_GRAYED);
	RemoveMenu(GetSystemMenu(console_hwnd, FALSE), SC_CLOSE, MF_BYCOMMAND);
      }
    }
  }

  if (!msg) {
    char *s;
    intptr_t l, d;
    DWORD wrote;

    s = va_arg(args, char*);
    d = va_arg(args, intptr_t);
    l = va_arg(args, intptr_t);

    WriteConsole(console_out, s XFORM_OK_PLUS d, l, &wrote, NULL);
  } else {
开发者ID:DanBurton,项目名称:racket,代码行数:52,代码来源:grmain.c

示例7: DestroyMenu

LONG CTEKWindow::OnChangeMenu(UINT wParam, LONG lParam)
{
	HMENU SysMenu;
	BOOL Show, B1, B2;

	Show = (ts.PopupMenu==0) && (ts.HideTitle==0);
	if (Show != (MainMenu!=NULL)) {
		if (! Show) {
			if (WinMenu!=NULL) {
				DestroyMenu(WinMenu);
			}
			WinMenu = NULL;
			DestroyMenu(MainMenu);
			MainMenu = NULL;
		}
		else {
			InitMenu(&MainMenu);
		}

		tk.AdjustSize = TRUE;
		::SetMenu(tk.HWin, MainMenu);
		::DrawMenuBar(HTEKWin);
	}

	B1 = ((ts.MenuFlag & MF_SHOWWINMENU)!=0);
	B2 = (WinMenu!=NULL);
	if ((MainMenu!=NULL) &&
	    (B1 != B2)) {
		if (WinMenu==NULL) {
			WinMenu = CreatePopupMenu();
			get_lang_msg("TEKMENU_WINDOW", ts.UIMsg, sizeof(ts.UIMsg), "&Window", ts.UILanguageFile);
			::InsertMenu(MainMenu,4,
			             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
			             (int)WinMenu, ts.UIMsg);
		}
		else {
			RemoveMenu(MainMenu,4,MF_BYPOSITION);
			DestroyMenu(WinMenu);
			WinMenu = NULL;
		}
		::DrawMenuBar(HTEKWin);
	}

	::GetSystemMenu(tk.HWin,TRUE);
	if ((! Show) && ((ts.MenuFlag & MF_NOSHOWMENU)==0)) {
		SysMenu = ::GetSystemMenu(tk.HWin,FALSE);
		AppendMenu(SysMenu, MF_SEPARATOR, 0, NULL);
		get_lang_msg("TEKMENU_SHOW_MENUBAR", ts.UIMsg, sizeof(ts.UIMsg), "Show menu &bar", ts.UILanguageFile);
		AppendMenu(SysMenu, MF_STRING, ID_SHOWMENUBAR, ts.UIMsg);
	}
	return 0;
}
开发者ID:pakls,项目名称:teraterm-ttssh2,代码行数:52,代码来源:tekwin.cpp

示例8: UpdateRW_RMenu

void UpdateRW_RMenu(HMENU menu, unsigned int mitem, unsigned int baseid)
{
	MENUITEMINFO moo;
	int x;

	moo.cbSize = sizeof(moo);
	moo.fMask = MIIM_SUBMENU | MIIM_STATE;

	GetMenuItemInfo(GetSubMenu(ramwatchmenu, 0), mitem, FALSE, &moo);
	moo.hSubMenu = menu;
	moo.fState = strlen(rw_recent_files[0]) ? MFS_ENABLED : MFS_GRAYED;

	SetMenuItemInfo(GetSubMenu(ramwatchmenu, 0), mitem, FALSE, &moo);

	// Remove all recent files submenus
	for(x = 0; x < MAX_RECENT_WATCHES; x++)
	{
		RemoveMenu(menu, baseid + x, MF_BYCOMMAND);
	}

	// Recreate the menus
	for(x = MAX_RECENT_WATCHES - 1; x >= 0; x--)
	{  
		char tmp[128 + 5];

		// Skip empty strings
		if(!strlen(rw_recent_files[x]))
		{
			continue;
		}

		moo.cbSize = sizeof(moo);
		moo.fMask = MIIM_DATA | MIIM_ID | MIIM_TYPE;

		// Fill in the menu text.
		if(strlen(rw_recent_files[x]) < 128)
		{
			sprintf(tmp, "&%d. %s", ( x + 1 ) % 10, rw_recent_files[x]);
		}
		else
		{
			sprintf(tmp, "&%d. %s", ( x + 1 ) % 10, rw_recent_files[x] + strlen( rw_recent_files[x] ) - 127);
		}

		// Insert the menu item
		moo.cch = strlen(tmp);
		moo.fType = 0;
		moo.wID = baseid + x;
		moo.dwTypeData = tmp;
		InsertMenuItem(menu, 0, 1, &moo);
	}
}
开发者ID:snowasnow,项目名称:DeSmuME,代码行数:52,代码来源:ramwatch.cpp

示例9: OnInitMenu

static void OnInitMenu(HWND hWnd)
{
    LONG lResult;
    HKEY hKey = NULL;
    DWORD dwIndex, cbValueName, cbValueData, dwType;
    TCHAR szValueName[256];
    BYTE abValueData[256];
    static int s_nFavoriteMenuSubPos = -1;
    HMENU hMenu;
    BOOL bDisplayedAny = FALSE;

    /* Find Favorites menu and clear it out */
    hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
    if (!hMenu)
        goto done;
    if (s_nFavoriteMenuSubPos < 0)
    {
        s_nFavoriteMenuSubPos = GetMenuItemCount(hMenu);
    }
    else
    {
        while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION))
            ;
    }

    lResult = RegOpenKey(HKEY_CURRENT_USER, s_szFavoritesRegKey, &hKey);
    if (lResult != ERROR_SUCCESS)
        goto done;

    dwIndex = 0;
    do
    {
        cbValueName = COUNT_OF(szValueName);
        cbValueData = sizeof(abValueData);
        lResult = RegEnumValue(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
        if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
        {
            if (!bDisplayedAny)
            {
                AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
                bDisplayedAny = TRUE;
            }
            AppendMenu(hMenu, 0, ID_FAVORITES_MIN + GetMenuItemCount(hMenu), szValueName);
        }
        dwIndex++;
    }
    while(lResult == ERROR_SUCCESS);

done:
    if (hKey)
        RegCloseKey(hKey);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:52,代码来源:framewnd.c

示例10: RefreshNavigMenu

void RefreshNavigMenu( intf_thread_t *p_intf, HMENU hMenu )
{
#define MAX_NAVIG_ITEMS 10

    vlc_object_t *p_object;
    char *ppsz_varnames[MAX_NAVIG_ITEMS];
    vlc_object_t * pi_objects[MAX_NAVIG_ITEMS];
    int i;

    /* Delete old menu */
    int count = wce_GetMenuItemCount( hMenu );
    for( i = 0; i <= count; i++ ) RemoveMenu( hMenu, 0, MF_BYPOSITION );
 
    if( p_intf->p_sys->p_navig_menu )
        MenuItemExt::ClearList( p_intf->p_sys->p_navig_menu );
    else p_intf->p_sys->p_navig_menu = new vector<MenuItemExt*>;

    /* Initializations */
    memset( pi_objects, 0, MAX_NAVIG_ITEMS * sizeof(vlc_object_t *) );
    i = 0;

    p_object = (vlc_object_t *)
        vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
    if( p_object != NULL )
    {
        ppsz_varnames[i] = "title";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "chapter";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "program";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "navigation";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "dvd_menus";
        pi_objects[i++] = p_object;

        ppsz_varnames[i] = "prev-title";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "next-title";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "prev-chapter";
        pi_objects[i++] = p_object;
        ppsz_varnames[i] = "next-chapter";
        pi_objects[i++] = p_object;

        vlc_object_release( p_object );
    }

    /* Build menu */
    RefreshMenu( p_intf, p_intf->p_sys->p_navig_menu, hMenu, i,
                 ppsz_varnames, pi_objects, NavigMenu_Events );
}
开发者ID:shanewfx,项目名称:vlc-arib,代码行数:52,代码来源:menus.cpp

示例11: populate_history_popup

void
populate_history_popup (void)
{
    int i;
    for (i = 0; i < RIPLIST_LEN; i++) {
	RemoveMenu (m_hmenu_context_sub, ID_MENU_HISTORY_LIST+i, MF_BYCOMMAND);
    }
    for (i = 0; i < RIPLIST_LEN; i++) {
	if (g_gui_prefs.riplist[i][0]) {
	    AppendMenu (m_hmenu_context_sub, MF_ENABLED | MF_STRING, ID_MENU_HISTORY_LIST+i, g_gui_prefs.riplist[i]);
	}
    }
}
开发者ID:dre-hh,项目名称:streamripper,代码行数:13,代码来源:plugin_main.c

示例12: hugsprim_RemoveMenu_30

static void hugsprim_RemoveMenu_30(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsWord32 arg2;
    HsWord32 arg3;
    HsBool res1;
    arg1 = hugs->getPtr();
    arg2 = hugs->getWord32();
    arg3 = hugs->getWord32();
    res1 = RemoveMenu(arg1, arg2, arg3);
    hugs->putBool(res1);
    hugs->returnIO(hugs_root,1);
}
开发者ID:xpika,项目名称:winhugs,代码行数:13,代码来源:Menu.c

示例13: playermenu_populate

void playermenu_populate( )
{
   HMENU menu = client::playermenu_menu( );
   if (menu)
   {
      assert( GetMenuItemCount( menu ) > 0 );

      MENUITEMINFO mii;
      memset( &mii, 0, sizeof( mii ) );
      mii.cbSize = sizeof( mii );

      /* Remove all the stuff we added. */
      {
         unsigned n = GetMenuItemCount( menu );
         mii.fMask = MIIM_DATA;
         for (unsigned i = 0; i < n; ++i)
         {
            GetMenuItemInfo( menu, i, TRUE, &mii );
            if (mii.dwItemData == 1337)
            {
               RemoveMenu( menu, i, MF_BYPOSITION );
               --n; --i;
            }
         }
      }      

      mii.fMask      = MIIM_FTYPE | MIIM_STRING | MIIM_SUBMENU | MIIM_STRING | MIIM_DATA;
      mii.fType      = MFT_STRING;
      mii.dwItemData = 1337;
      bool added = false;

      for (vector<MODULE*>::const_iterator i = g_modules.begin( ); i != g_modules.end( ); ++i)
      {
         if ((*i)->menu && GetMenuItemCount( (*i)->menu ) > 0)
         {
            mii.dwTypeData = const_cast<char*>( (*i)->fancy_name.c_str( ) );
            mii.hSubMenu = (*i)->menu;
            InsertMenuItem( menu, GetMenuItemCount( menu ) - 1, TRUE, &mii );
            added = true;
         }
      }

      if (added)
      {
         /* Insert a separator before the shortname. */
         mii.fMask  = MIIM_TYPE | MIIM_DATA;
         mii.fType  = MFT_SEPARATOR;
         InsertMenuItem( menu, GetMenuItemCount( menu ) - 1, TRUE, &mii );
      }
   }
}
开发者ID:Gerolkae,项目名称:Furnarchy,代码行数:51,代码来源:modules.cpp

示例14: LoadMenu

void ProductList::ShowRMenu()
{
	HMENU hMenu = LoadMenu(IDR_MENU_PRODUCT);
	HMENU hMenuPop = GetSubMenu(hMenu, 0);

	if (GetCount() == 0)
	{
		RemoveMenu(hMenuPop, 1, MF_BYPOSITION);	//删除分隔线
		RemoveMenu(hMenuPop, 1, MF_BYPOSITION);	//删除导出列表
	}
	else if(GetCount() == 1)
		if(GetText(0) == TEXT("<null>"))
			return ;

	SendMessage(getParent(), NM_SETPOPMENULANG, (WPARAM)hMenuPop, (LPARAM)"Product");

	POINT pt;
	::GetCursorPos(&pt);

	::TrackPopupMenuEx(hMenuPop, TPM_BOTTOMALIGN, pt.x, pt.y, getParent(), 0);

	::DestroyMenu(hMenuPop);
}
开发者ID:hisham2300,项目名称:navifirmex,代码行数:23,代码来源:ProductList.cpp

示例15: InitTrayCBWnd

void InitTrayCBWnd(BOOL bCreate)
{
	LONG i, lMMItemCnt, lTMItemCnt;
	if (bCreate)
	{
		WCHAR lpwText[MAX_PATH] = { 0 };
		hTrayMenu = CreatePopupMenu();
		AppendMenu(hTrayMenu, MF_STRING, IDM_TRAY_HIDESHOW, L"&Hide/Show Player");
		AppendMenu(hTrayMenu, MF_SEPARATOR, 0, 0);
		lMMItemCnt = GetMenuItemCount(GetMenu(hMainWnd));
		for (i = 0; i < lMMItemCnt; i++)
		{
			GetMenuString(GetMenu(hMainWnd), i, lpwText, MAX_PATH, MF_BYPOSITION);
			AppendMenu(hTrayMenu, MF_STRING | MF_POPUP, (UINT_PTR)GetSubMenu(GetMenu(hMainWnd),
				i), lpwText);
		}
		SetMenuDefaultItem(hTrayMenu, IDM_TRAY_HIDESHOW, FALSE);
		WCEX.cbSize = sizeof(WNDCLASSEX); 
		WCEX.lpfnWndProc = (WNDPROC)TrayCBWndProc;
		WCEX.hInstance = hAppInstance;
		WCEX.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
		WCEX.lpszClassName = TRAY_CB_WND_CLASS;
		RegisterClassEx(&WCEX);
		hTrayCBWnd = CreateWindow(WCEX.lpszClassName, 0, WS_POPUP,
			16, 16, 32, 32, 0, hTrayMenu, hAppInstance, 0);
		if (!dwNoOwnerDrawMenu)
		{
			pEBMenuTray->hBmpCheck = (HBITMAP)LoadImage(hAppInstance, MAKEINTRESOURCE(IDB_CHECKMARK),
				IMAGE_BITMAP, 16, 16, 0);
			pEBMenuTray->hBmpRadioCheck = (HBITMAP)LoadImage(hAppInstance, MAKEINTRESOURCE(IDB_RADIOCHECKMARK),
				IMAGE_BITMAP, 16, 16, 0);
			pEBMenuTray->InitEBMenu(hTrayCBWnd, TRUE);
		}
	}
	else
	{
		if (!dwNoOwnerDrawMenu) pEBMenuTray->InitEBMenu(0);
		lMMItemCnt = GetMenuItemCount(GetMenu(hMainWnd));
		lTMItemCnt = GetMenuItemCount(hTrayMenu);
		for (i = (lTMItemCnt - 1); i >= (lTMItemCnt - lMMItemCnt); i--)
		{
			RemoveMenu(hTrayMenu, i, MF_BYPOSITION);
		}
		DestroyMenu(hTrayMenu);
		hTrayMenu = 0;
		DestroyWindow(hTrayCBWnd);
		hTrayCBWnd = 0;
	}
}
开发者ID:BorisVorontsov,项目名称:easybar,代码行数:49,代码来源:TrayIcon.cpp


注:本文中的RemoveMenu函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。