这篇教程C++ GetSystemMenu函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetSystemMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSystemMenu函数的具体用法?C++ GetSystemMenu怎么用?C++ GetSystemMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetSystemMenu函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: m_OwnConsoleCConsole::CConsole() : m_OwnConsole(false) { if (!AllocConsole()) return; SetConsoleCtrlHandler(MyConsoleCtrlHandler, TRUE); RemoveMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND); const int in = _open_osfhandle(INT_PTR(GetStdHandle(STD_INPUT_HANDLE)), _O_TEXT); const int out = _open_osfhandle(INT_PTR(GetStdHandle(STD_OUTPUT_HANDLE)), _O_TEXT); m_OldStdin = *stdin; m_OldStdout = *stdout; *stdin = *_fdopen(in, "r"); *stdout = *_fdopen(out, "w"); m_OwnConsole = true;}
开发者ID:Kilandor,项目名称:Payday-2-BLT,代码行数:15,
示例2: SetupSysMenu/* * Add the default or a custom menu depending on the class match */voidSetupSysMenu(unsigned long hwndIn){ HWND hwnd; HMENU sys; int i; WindowPtr pWin; char *res_name, *res_class; hwnd = (HWND) hwndIn; if (!hwnd) return; pWin = GetProp(hwnd, WIN_WINDOW_PROP); sys = GetSystemMenu(hwnd, FALSE); if (!sys) return; if (pWin) { /* First see if there's a class match... */ if (winMultiWindowGetClassHint(pWin, &res_name, &res_class)) { for (i = 0; i < pref.sysMenuItems; i++) { if (!strcmp(pref.sysMenu[i].match, res_name) || !strcmp(pref.sysMenu[i].match, res_class)) { free(res_name); free(res_class); MakeMenu(pref.sysMenu[i].menuName, sys, pref.sysMenu[i].menuPos == AT_START ? 0 : -1); return; } } /* No match, just free alloc'd strings */ free(res_name); free(res_class); } /* Found wm_class */ } /* if pwin */ /* Fallback to system default */ if (pref.defaultSysMenuName[0]) { if (pref.defaultSysMenuPos == AT_START) MakeMenu(pref.defaultSysMenuName, sys, 0); else MakeMenu(pref.defaultSysMenuName, sys, -1); }}
开发者ID:LeadHyperion,项目名称:RaspberryPiXServer,代码行数:51,
示例3: windowsInitstatic int windowsInit( HINSTANCE hinstance ){ WNDCLASS wc; /* Window class */ HMENU hSysMenu; emfInstSet( ( int ) hinstance ); wc.style = CS_HREDRAW | CS_VREDRAW; wc.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 ); wc.hCursor = LoadCursor( NULL, IDC_ARROW ); wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinstance; wc.hIcon = NULL; wc.lpfnWndProc = ( WNDPROC ) websWindProc; wc.lpszMenuName = wc.lpszClassName = name; if ( ! RegisterClass( &wc ) ) { return -1; } /* * Create a window just so we can have a taskbar to close this web server */ hwnd = CreateWindow( name, title, WS_MINIMIZE | WS_POPUPWINDOW, CW_USEDEFAULT, 0, 0, 0, NULL, NULL, hinstance, NULL ); if ( hwnd == NULL ) { return -1; } /* * Add the about box menu item to the system menu * a_assert: IDM_ABOUTBOX must be in the system command range. */ hSysMenu = GetSystemMenu( hwnd, FALSE ); if ( hSysMenu != NULL ) { AppendMenu( hSysMenu, MF_SEPARATOR, 0, NULL ); AppendMenu( hSysMenu, MF_STRING, IDM_ABOUTBOX, T( "About WebServer" ) ); } ShowWindow( hwnd, SW_SHOWNORMAL ); UpdateWindow( hwnd ); hwndAbout = NULL; return 0;}
开发者ID:codywon,项目名称:bell-jpg,代码行数:48,
示例4: ASSERTBOOL CTranslateDlg::OnInitDialog(){ CDialogEx::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here CStringArray sLanguages; m_cTranslator.GetAllLanguages(sLanguages); int count = sLanguages.GetCount(); for (int i = 0 ; i < count; i++) m_cToLang.AddString(sLanguages.GetAt(i)); if(count) m_cToLang.SelectString(0, _T("Kannada")); m_font.CreateFont(30, 0, 0, 0, FW_DEMIBOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, 0, 0, 0, 0, NULL); m_cTranslatedText.SetFont(&m_font,TRUE); m_Errorfont.CreateFont(20, 0, 0, 0, FW_NORMAL, TRUE, FALSE, 0, DEFAULT_CHARSET, 0, 0, 0, 0, NULL); m_cErrorText.SetFont(&m_Errorfont,TRUE); return TRUE; // return TRUE unless you set the focus to a control}
开发者ID:suresh3554,项目名称:MFC-Windows-Programs,代码行数:48,
示例5: ModifyStyleBOOL DFUSheet::OnInitDialog() { // Pass on to the base class first BOOL result = CPropertySheet::OnInitDialog(); // Modified behaviour for development mode if (developmentMode) { // Add a minimize icon ModifyStyle(0, WS_MINIMIZEBOX, 0); GetSystemMenu(false)->AppendMenu(MF_STRING, SC_MINIMIZE, _T("Minimize")); } // Return the result return result;}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:16,
示例6: GetSystemMenuvoid TaskBar::ShowAppSystemMenu(TaskBarMap::iterator it){ HMENU hmenu = GetSystemMenu(it->first, FALSE); if (hmenu) { POINT pt; GetCursorPos(&pt); int cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, _hwnd, NULL); if (cmd) { ActivateApp(it, false, false); // reactivate window after the context menu has closed PostMessage(it->first, WM_SYSCOMMAND, cmd, 0); } }}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:16,
示例7: AfxMessageBoxvoid CMainFrame::OnClose() { if(m_pApp->m_iCurrentTasks>0) { AfxMessageBox("You have " + str(m_pApp->m_iCurrentTasks)+ " job(s) pending completion. Please wait for this to finish before closing."); } else { //disable close system menu. CMenu* pmenu = GetSystemMenu(FALSE); UINT size = pmenu->GetMenuItemCount( ); pmenu->EnableMenuItem(pmenu->GetMenuItemID(6), MF_DISABLED | MF_GRAYED); DrawMenuBar(); //instead of the 2 phase shutdown, i'm //just gonna risk leaking a little memory //and simplify the code. markme saw a crash here. m_pApp->Terminate(); //close the frame. CMDIFrameWnd::OnClose(); //ALERT. Unusual code. //This is a 2phase shutdown to ensure we don't leak any memory due to floating msgs coming //in from the server. /*if(m_ShutDownPhase==0) { if(E_FAIL==m_pApp->Terminate()) { //Terminate's already happened. Shutdown now. m_ShutDownPhase = 0; CMDIFrameWnd::OnClose(); return; } m_ShutDownPhase=-23; //number same as below. number not used anywhere else. PostMessage(WM_CLOSE); } else if(m_ShutDownPhase==-23) //see number above. { m_ShutDownPhase = 0; CMDIFrameWnd::OnClose(); } else ASSERT(0); */ }}
开发者ID:opensim4opencog,项目名称:PrologVirtualWorlds,代码行数:47,
示例8: TRACE0int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct){ if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar/n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar/n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to // be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); m_wndToolBar.ShowWindow(SW_HIDE); m_wndStatusBar.ShowWindow(SW_HIDE); this->SetMenu(0); ASSERT((ID_APP_ABOUT & 0xFFF0) == ID_APP_ABOUT); ASSERT(ID_APP_ABOUT < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu(" C++ GetSystemTime函数代码示例 C++ GetSystemInfo函数代码示例
|