您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetMenu函数代码示例

51自学网 2021-06-01 21:10:42
  C++
这篇教程C++ GetMenu函数代码示例写得很实用,希望能帮到您。

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

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

示例1: SetMenu

BOOL CPrefabDlg::OnInitDialog(){	CDialog::OnInitDialog();	CMenu menu;	menu.LoadMenu(IDR_MENU2);	SetMenu(&menu);	menu.Detach();	if (g_editorMode == eMODE_PREFAB)	{		GetMenu()->EnableMenuItem(ID_PACKAGE_NEW, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PACKAGE_RENAMESELECTED, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PACKAGE_DELETESELECTED, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PREFAB_NEW, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PREFAB_OPENSELECTED, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PREFAB_RENAMESELECTED, MF_ENABLED);		GetMenu()->EnableMenuItem(ID_PREFAB_DELETESELECTED, MF_ENABLED);		m_btnInsertPrefab.SetWindowTextA("Open Prefab");	}	else	{		GetMenu()->EnableMenuItem(ID_PACKAGE_NEW, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PACKAGE_RENAMESELECTED, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PACKAGE_DELETESELECTED, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PREFAB_NEW, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PREFAB_OPENSELECTED, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PREFAB_RENAMESELECTED, MF_DISABLED | MF_GRAYED);		GetMenu()->EnableMenuItem(ID_PREFAB_DELETESELECTED, MF_DISABLED | MF_GRAYED);		m_btnInsertPrefab.SetWindowTextA("Insert Prefab");	}	m_slideLod.SetRange(0, 2);	CBitmap cBmp;	CBitmap* cBmpMask = NULL;	m_packageListImage.Create(36, 36, ILC_COLOR24, 1, 1);	cBmp.LoadBitmap(IDB_BITMAP_DEFAULT_PACKAGE);	m_packageListImage.Add(&cBmp, cBmpMask);	cBmp.DeleteObject();	RECT tempRect;	m_listPrefabPackages.GetClientRect(&tempRect);	m_listPrefabPackages.SetImageList(&m_packageListImage, LVSIL_SMALL);	m_listPrefabPackages.InsertColumn(0, "Packages", LVCFMT_CENTER | LVS_SHOWSELALWAYS, (tempRect.right - tempRect.left) * 80 / 100);	m_listPrefabPackages.ShowWindow(SW_SHOW);	m_listPrefabPackages.UpdateWindow();	m_prefabListImage.Create(80, 80, ILC_COLOR24, 1, 1);	cBmp.LoadBitmap(IDB_BITMAP_DEFAULT_VPF);	m_prefabListImage.Add(&cBmp, cBmpMask);	cBmp.DeleteObject();	m_listPrefabs.SetImageList(&m_prefabListImage, LVSIL_NORMAL);	m_listPrefabs.GetClientRect(&tempRect);	m_listPrefabs.InsertColumn(0, "Prefabs", LVCFMT_LEFT | LVS_SHOWSELALWAYS, (tempRect.right - tempRect.left) * 80 / 100);	m_listPrefabs.ShowWindow(SW_SHOW);	m_listPrefabs.UpdateWindow();	//insert items	for (CUInt i = 0; i < g_prefabPackagesAndNames.size(); i++)	{		CChar str[MAX_NAME_SIZE];		Cpy(str, g_prefabPackagesAndNames[i].front().c_str());		if (!Cmp(str, "Vanda_Basics"))			InsertItemToPackageList(str);	}	RECT rect;	m_listPrefabProperties.GetClientRect(&rect);	m_listPrefabProperties.InsertColumn(0, "Parameters", LVCFMT_LEFT, rect.right - rect.left, 1);	m_listPrefabProperties.SetExtendedStyle(LVS_EX_INFOTIP | LVS_EX_ONECLICKACTIVATE | LVS_EX_LABELTIP);	InserItemToPropertiesList("Vertices");	InserItemToPropertiesList("Textures");	return TRUE;  // return TRUE unless you set the focus to a control	// EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:DCubix,项目名称:1.4.0,代码行数:81,


示例2: Toolbar_UpdateUI

void Toolbar_UpdateUI(  HWND hwnd)  {   HWND hwndFrame;   HMENU hmenu;   unsigned nCount;   /*=======================================*/   /* Get frame window (parent of toolbar). */   /*=======================================*/      hwndFrame = GetParent(hwnd);   ASSERT(NULL != hwndFrame);   /*===================================*/   /* Get the main frame window's menu. */   /*===================================*/      hmenu = GetMenu(hwndFrame);   //ASSERT (NULL != hmenu) ;   if (NULL == hmenu)     { return; }   /*======================================*/   /* Get count of buttons on the toolbar. */   /*======================================*/      nCount = Toolbar_ButtonCount(hwnd);   /*===================================*/   /* For each button on the toolbar... */   /*===================================*/      while (nCount > 0)      {      BOOL bMenuEnabled, bButtonEnabled;      TBBUTTON tbb;      UINT uiState;      /*===================================*/      /* Get information about the button. */      /*===================================*/            VERIFY(Toolbar_GetButton(hwnd,--nCount,&tbb));      /*==========================================*/      /* If the button is a separator, ignore it. */      /*==========================================*/            if (tbb.fsStyle & TBSTYLE_SEP)        { continue; }      /*=========================================*/      /* Get information about the corresponding */      /* menu item, if any.                      */      /*=========================================*/            uiState = GetMenuState(hmenu,(unsigned) tbb.idCommand,MF_BYCOMMAND);      if (0xFFFFFFFF == uiState)        { bMenuEnabled = FALSE; }      else        { bMenuEnabled = 0 == (uiState & (MF_DISABLED | MF_GRAYED)); }      bButtonEnabled = 0 != (tbb.fsState & TBSTATE_ENABLED);      /*===========================================*/      /* If button and menu are in the same state, */      /* we need do nothing for this button.       */      /*===========================================*/            if (bMenuEnabled == bButtonEnabled)        { continue; }      /*=====================================*/      /* Enable/Disable this toolbar button. */      /*=====================================*/            VERIFY(Toolbar_EnableButton(hwnd,tbb.idCommand,bMenuEnabled));     }  }
开发者ID:noxdafox,项目名称:clips,代码行数:81,


示例3: MainProc

//.........这里部分代码省略.........            msg = WM_MBUTTONDOWN;        }        TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );        return 0;    case WM_RBUTTONUP:        WINE_TRACE("WM_RBUTTONUP/n");        if( wParam & MK_LBUTTON )            msg = WM_MBUTTONUP;        TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );        return 0;    case WM_MBUTTONDOWN:        WINE_TRACE("WM_MBUTTONDOWN/n");        TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );        return 0;    case WM_MBUTTONUP:        WINE_TRACE("WM_MBUTTONUP/n");        TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg );        return 0;    case WM_MOUSEMOVE:    {        if( ( wParam & MK_MBUTTON ) ||            ( ( wParam & MK_LBUTTON ) && ( wParam & MK_RBUTTON ) ) ) {            msg = WM_MBUTTONDOWN;        }        else if( wParam & MK_LBUTTON ) {            msg = WM_LBUTTONDOWN;        }        else {            return 0;        }        TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam),  msg );        return 0;    }    case WM_COMMAND:        switch(LOWORD(wParam)) {        case IDM_NEW:            CreateBoard( &board );            return 0;        case IDM_MARKQ:            hMenu = GetMenu( hWnd );            board.IsMarkQ = !board.IsMarkQ;            if( board.IsMarkQ )                CheckMenuItem( hMenu, IDM_MARKQ, MF_CHECKED );            else                CheckMenuItem( hMenu, IDM_MARKQ, MF_UNCHECKED );            return 0;        case IDM_BEGINNER:            SetDifficulty( &board, BEGINNER );            CreateBoard( &board );            return 0;        case IDM_ADVANCED:            SetDifficulty( &board, ADVANCED );            CreateBoard( &board );            return 0;        case IDM_EXPERT:            SetDifficulty( &board, EXPERT );            CreateBoard( &board );            return 0;        case IDM_CUSTOM:            SetDifficulty( &board, CUSTOM );            CreateBoard( &board );            return 0;        case IDM_EXIT:            SendMessageW( hWnd, WM_CLOSE, 0, 0);            return 0;        case IDM_TIMES:            DialogBoxParamW( board.hInst, MAKEINTRESOURCEW(DLG_TIMES), hWnd,                             TimesDlgProc, (LPARAM) &board);            return 0;        case IDM_ABOUT:        {            WCHAR appname[256], other[256];            LoadStringW( board.hInst, IDS_APPNAME, appname, sizeof(appname)/sizeof(WCHAR) );            LoadStringW( board.hInst, IDS_ABOUT, other, sizeof(other)/sizeof(WCHAR) );            ShellAboutW( hWnd, appname, other,                         LoadImageW(board.hInst, MAKEINTRESOURCEW(IDI_WINEMINE), IMAGE_ICON, 48, 48, LR_SHARED));            return 0;        }        default:            WINE_TRACE("Unknown WM_COMMAND command message received/n");            break;        }    }    return DefWindowProcW( hWnd, msg, wParam, lParam );}
开发者ID:AndreRH,项目名称:wine,代码行数:101,


示例4: Show

	BOOL Show(HINSTANCE hInstance, int nCmdShow)	{		hInst = hInstance; // Store instance handle in our global variable		int zoom = g_Config.iWindowZoom;		if (zoom < 1) zoom = 1;		if (zoom > 4) zoom = 4;				RECT rc, rcOrig;		GetWindowRectAtZoom(zoom, rcOrig, rc);		u32 style = WS_OVERLAPPEDWINDOW;		hwndMain = CreateWindowEx(0,szWindowClass, "", style,			rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL);		if (!hwndMain)			return FALSE;		hwndDisplay = CreateWindowEx(0, szDisplayClass, TEXT(""), WS_CHILD | WS_VISIBLE,			rcOrig.left, rcOrig.top, rcOrig.right - rcOrig.left, rcOrig.bottom - rcOrig.top, hwndMain, 0, hInstance, 0);		if (!hwndDisplay)			return FALSE;		menu = GetMenu(hwndMain);#ifdef FINAL		RemoveMenu(menu,2,MF_BYPOSITION);		RemoveMenu(menu,2,MF_BYPOSITION);#endif		MENUINFO info;		ZeroMemory(&info,sizeof(MENUINFO));		info.cbSize = sizeof(MENUINFO);		info.cyMax = 0;		info.dwStyle = MNS_CHECKORBMP;		info.fMask = MIM_STYLE;		for (int i = 0; i < GetMenuItemCount(menu); i++)		{			SetMenuInfo(GetSubMenu(menu,i),&info);		}		UpdateMenus();		//accept dragged files		DragAcceptFiles(hwndMain, TRUE);		hideCursor = true;		SetTimer(hwndMain, TIMER_CURSORUPDATE, CURSORUPDATE_INTERVAL_MS, 0);		Update();		SetPlaying(0);				ShowWindow(hwndMain, nCmdShow);		W32Util::MakeTopMost(hwndMain, g_Config.bTopMost);#if ENABLE_TOUCH		RegisterTouchWindow(hwndDisplay, TWF_WANTPALM);#endif		RAWINPUTDEVICE keyboard;		memset(&keyboard, 0, sizeof(keyboard));		keyboard.usUsagePage = 1;		keyboard.usUsage = 6;		keyboard.dwFlags = 0; // RIDEV_NOLEGACY | ;		RegisterRawInputDevices(&keyboard, 1, sizeof(RAWINPUTDEVICE));		SetFocus(hwndDisplay);		return TRUE;	}
开发者ID:AnimeReference,项目名称:ppsspp,代码行数:68,


示例5: CheckUndoMenu

void CheckUndoMenu(HWND hwnd, BOOL bEnable){	bUndo = bEnable;	EnableMenuItem(GetMenu(hwnd), IDM_UNDO, MF_BYCOMMAND | (bEnable ? MF_ENABLED : MF_GRAYED));}
开发者ID:larryli,项目名称:BoxWorld,代码行数:5,


示例6: switch

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 回调函数LRESULT CALLBACK CMainWnd::MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){	CChildWnd *pWnd;	TCHAR tzTemp[MAX_PATH];	switch (uMsg)	{	case WM_CREATE:		// 窗口被创建		m_hWnd = hWnd;		m_hMenu = GetMenu(m_hWnd);		OnCreate();		break;	case WM_SIZE:		// 尺寸改变		OnSize(wParam, lParam);		return 0;	case WM_WINDOWPOSCHANGED:		// 位置改变		for (pWnd = CChildWnd::m_pHead; pWnd; pWnd = pWnd->m_pNext)		{			if (pWnd->m_hWnd)			{				pWnd->SetDrawRect();			}		}		break;	case WM_INITMENUPOPUP:		// 弹出菜单初始化		OnMenuPopup(wParam, lParam);		break;	case WM_MENUSELECT:		// 菜单项被选择		OnMenuSelect(LOWORD(wParam));		break;	case WM_EXITMENULOOP:		// 退出菜单循环		CClientWnd::SetStatusText(LNG_Ready);		break;	case WM_COMMAND:		// 命令处理		OnCommand(wParam, lParam);		break;	case WM_COPYDATA:		// 本程序的其它实例通知打开文件		if (((PCOPYDATASTRUCT) lParam)->dwData == IDM_File_Open)		{			static TCHAR s_tzFileName[MAX_PATH];			lstrcpyn(s_tzFileName, (PTSTR) ((PCOPYDATASTRUCT) lParam)->lpData, MAX_PATH);			PostMessage(m_hWnd, WM_COMMAND, IDM_File_Open, (LPARAM) s_tzFileName);		}		break;	case WM_HOTKEY:		// 热键消息		if ((m_hWnd != GetForegroundWindow()) && (wParam == IDC_TrayIcon))		{			OnTrayIcon(FALSE);		}		break;	case WM_DROPFILES:		// 拖动文件		DragQueryFile((HDROP) wParam, 0, tzTemp, MAX_PATH);		DragFinish((HDROP) wParam);		OnFileOpen(tzTemp);		break;	case WM_HELP:		// 帮助		OnCommand(IDM_Help_Content);		break;	case WM_DESTROY:		// 窗口被销毁		OnDestroy();		break;	}	return DefFrameProc(hWnd, CClientWnd::m_hWnd, uMsg, wParam, lParam);}
开发者ID:Yonsm,项目名称:RawPlayer,代码行数:91,


示例7: UpdateMenu

void UpdateMenu(HWND hWnd){    HMENU hMenu = GetMenu(hWnd);    CheckMenuRadioItem(hMenu, IDM_VIEW_25, IDM_VIEW_400, IDM_VIEW_100 + iViewScale, MF_BYCOMMAND);    CheckMenuItem(hMenu, ID_VIEW_ANIMATE, bAnimate ? MF_CHECKED : MF_UNCHECKED);}
开发者ID:hackshields,项目名称:antivirus,代码行数:6,


示例8: MainWindowProc

//.........这里部分代码省略.........                            case IDS_CAT_INTERNET:                                UpdateApplicationsList(ENUM_CAT_INTERNET);                                break;                            case IDS_CAT_LIBS:                                UpdateApplicationsList(ENUM_CAT_LIBS);                                break;                            case IDS_CAT_OFFICE:                                UpdateApplicationsList(ENUM_CAT_OFFICE);                                break;                            case IDS_CAT_OTHER:                                UpdateApplicationsList(ENUM_CAT_OTHER);                                break;                            case IDS_CAT_SCIENCE:                                UpdateApplicationsList(ENUM_CAT_SCIENCE);                                break;                            case IDS_CAT_TOOLS:                                UpdateApplicationsList(ENUM_CAT_TOOLS);                                break;                            case IDS_CAT_VIDEO:                                UpdateApplicationsList(ENUM_CAT_VIDEO);                                break;                        }                    }                    /* Disable/enable items based on treeview selection */                    if (IsSelectedNodeInstalled())                    {                        EnableMenuItem(GetMenu(hwnd), ID_REGREMOVE, MF_ENABLED);                        EnableMenuItem(GetMenu(hwnd), ID_INSTALL, MF_GRAYED);                        EnableMenuItem(GetMenu(hwnd), ID_UNINSTALL, MF_ENABLED);                        EnableMenuItem(GetMenu(hwnd), ID_MODIFY, MF_ENABLED);                        EnableMenuItem(GetMenu(hListView), ID_REGREMOVE, MF_ENABLED);                        EnableMenuItem(GetMenu(hListView), ID_INSTALL, MF_GRAYED);                        EnableMenuItem(GetMenu(hListView), ID_UNINSTALL, MF_ENABLED);                        EnableMenuItem(GetMenu(hListView), ID_MODIFY, MF_ENABLED);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_REGREMOVE, TRUE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_INSTALL, FALSE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_MODIFY, TRUE);                    }                    else                    {                        EnableMenuItem(GetMenu(hwnd), ID_REGREMOVE, MF_GRAYED);                        EnableMenuItem(GetMenu(hwnd), ID_INSTALL, MF_ENABLED);                        EnableMenuItem(GetMenu(hwnd), ID_UNINSTALL, MF_GRAYED);                        EnableMenuItem(GetMenu(hwnd), ID_MODIFY, MF_GRAYED);                        EnableMenuItem(GetMenu(hListView), ID_REGREMOVE, MF_GRAYED);                        EnableMenuItem(GetMenu(hListView), ID_INSTALL, MF_ENABLED);                        EnableMenuItem(GetMenu(hListView), ID_UNINSTALL, MF_GRAYED);                        EnableMenuItem(GetMenu(hListView), ID_MODIFY, MF_GRAYED);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_REGREMOVE, FALSE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_INSTALL, TRUE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_UNINSTALL, FALSE);                        SendMessage(hToolBar, TB_ENABLEBUTTON, ID_MODIFY, FALSE);                    }                }
开发者ID:Strongc,项目名称:reactos,代码行数:67,


示例9: GetItem

PObjectBase MenuEditor::GetMenu(long& n, PObjectDatabase base, bool isSubMenu){	// Get item from list control    wxString label, shortcut, id, name, help, kind;	PObjectBase menu;    GetItem(n, label, shortcut, id, name, help, kind, &menu);	bool createNew = true;	if ( menu )	{		createNew = ( menu->GetClassName() != (isSubMenu ? wxT("submenu") : wxT("wxMenu")) );	}    // preserve original menu if the object types match    // this preserves properties that are not exposed in the menu editor - like C++ scope    if ( createNew  )    {		PObjectInfo info = base->GetObjectInfo(isSubMenu ? wxT("submenu") : wxT("wxMenu") );		menu = base->NewObject(info);    }    label.Trim(true); label.Trim(false);    menu->GetProperty( wxT("label") )->SetValue(label);    menu->GetProperty( wxT("name") )->SetValue(name);    int ident = GetItemIdentation(n);    n++;    while (n < m_menuList->GetItemCount() && GetItemIdentation(n) > ident)    {    	PObjectBase menuitem;        GetItem(n, label, shortcut, id, name, help, kind, &menuitem);		createNew = true;        label.Trim(true); label.Trim(false);        if (label == wxT("---"))        {        	if ( menuitem )        	{        		createNew = ( menuitem->GetClassName() != wxT("separator") );        	}        	if ( createNew )        	{				PObjectInfo info = base->GetObjectInfo( wxT("separator") );				menuitem = base->NewObject(info);        	}            menu->AddChild(menuitem);            menuitem->SetParent(menu);            n++;        }        else if (HasChildren(n))        {            PObjectBase child = GetMenu(n, base);            menu->AddChild(child);            child->SetParent(menu);        }        else        {        	if ( menuitem )        	{        		createNew = ( menuitem->GetClassName() != wxT("wxMenuItem") );        	}        	if ( createNew )        	{				PObjectInfo info = base->GetObjectInfo( wxT("wxMenuItem") );				menuitem = base->NewObject(info);        	}            menuitem->GetProperty( wxT("label") )->SetValue(label);            menuitem->GetProperty( wxT("shortcut") )->SetValue(shortcut);            menuitem->GetProperty( wxT("name") )->SetValue(name);			menuitem->GetProperty( wxT("help") )->SetValue(help);            menuitem->GetProperty( wxT("id") )->SetValue(id);            menuitem->GetProperty( wxT("kind") )->SetValue(kind);            menu->AddChild(menuitem);            menuitem->SetParent(menu);            n++;        }    }    return menu;}
开发者ID:Three-DS,项目名称:wxformbuilder-3.5.0,代码行数:84,


示例10: ChatPopDown

// front endvoid ChatPopDown(){  if(--chatCount <= 0)	CheckMenuItem(GetMenu(hwndMain), IDM_NewChat, MF_UNCHECKED);}
开发者ID:aneternalgoldenbraid,项目名称:xboard,代码行数:6,


示例11: init

void init(){	RgnHandle			tempRgn;	Rect				BaseRect;	OSErr				err;	long				QDfeature/*, OSfeature*/;	GDHandle			SaveGD;	CGrafPtr			SavePort;	/*	Initialize Managaer.	*/	//InitGraf(&qd.thePort);	//InitWindows();	//InitDialogs(nil);	InitCursor();	FlushEvents(everyEvent, 0);		/*	Set up menus.	*/	mymenu0 = GetMenu(appleID);	//AppendResMenu(mymenu0, 'DRVR');	InsertMenu(mymenu0,0);	mymenu1 = GetMenu(fileID);	InsertMenu(mymenu1,0);	DrawMenuBar();	DoneFlag = false;	ThePict = GetPicture(PictID);	if (ThePict == nil)		DoneFlag = true;	/*	Use Gestalt to find is QuickDraw is avaiable.	*/	/*if ((GetOSTrapAddress(Gestalttest) != GetOSTrapAddress(NoTrap))) {		err = Gestalt(gestaltQuickdrawVersion, &QDfeature);		if (err)			DoneFlag = true;		err = Gestalt(gestaltSystemVersion, &OSfeature);		if (err)			DoneFlag = true;		if (!DoneFlag && (QDfeature & 0x0f00) != 0x0200 && OSfeature < 0x0605)			DoneFlag = true;		}	else		DoneFlag = true;*/		err = Gestalt(gestaltQuickdrawVersion, &QDfeature);	if (err != noErr || QDfeature < gestalt32BitQD)		DoneFlag = true;	/*	Set Rects.	*/	SetRect(&BaseRect, 40, 60, 472, 282);	SetRect(&WinMinusScroll, BaseRect.left-40, BaseRect.top-60, BaseRect.right-60, 				BaseRect.bottom - 80);	SetRect(&InitWindowSize, WinMinusScroll.left, WinMinusScroll.top, 							WinMinusScroll.right, WinMinusScroll.bottom);	tempRgn = GetGrayRgn();	HLock ((Handle) tempRgn);	//TotalRect = (**tempRgn).rgnBBox;	GetRegionBounds(tempRgn, &TotalRect);	/*SetRect(&minRect, 80, 80, (**tempRgn).rgnBBox.right - 40, 				(**tempRgn).rgnBBox.bottom - 40);*/	SetRect(&minRect, 80, 80, TotalRect.right - 40, TotalRect.bottom - 40);	HUnlock ((Handle) tempRgn);	/*	Open window and set up picture.	*/	GetGWorld (&SavePort, &SaveGD);	mycolors = GetCTable (clutID);	(*mycolors)->ctFlags |= 0x4000;	myWindow = NewCWindow(nil, &BaseRect, (ConstStr255Param)"", true, zoomDocProc, 							(WindowPtr) -1, true, 150);	SetGWorld(GetWindowPort(myWindow), SaveGD);	DrawGrowIcon (myWindow);	srcPalette = NewPalette (((**mycolors).ctSize)+1, mycolors,			pmTolerant + pmExplicit + pmAnimated, 0);	SetPalette ((WindowPtr) myWindow, srcPalette, true);		GetGWorld (&SavePort, &SaveGD);	err = NewGWorld (&offscreenGWorld, 8, &InitWindowSize, mycolors, nil, 0);	if (err)		Debugger();	SetGWorld (offscreenGWorld, nil);	EraseRect (&InitWindowSize);	DrawPicture (ThePict, &InitWindowSize);	SetGWorld (SavePort, SaveGD);}
开发者ID:fruitsamples,项目名称:CopyBitsSpeedPalette,代码行数:84,


示例12: SafeGetMenu

pascal MenuHandle SafeGetMenu(short resourceID){		StAcroResourceContext resContext;	return GetMenu(resourceID);}
开发者ID:Ulysses1962,项目名称:light-imposition,代码行数:6,


示例13: WndProc

//.........这里部分代码省略.........		distance_caption_handle = CreateWindowEx(WS_EX_TRANSPARENT, "STATIC", "Distance Thres:", WS_CHILD | WS_VISIBLE,			thirdcolPos + 10, horzSeparatorPos + 10, 110, 30, hWnd, (HMENU)IDC_STATIC_DISTANCE_THRES, GetModuleHandle(NULL), NULL);		distance_handle = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", std::to_string(DEFAULT_DISTANCE_THRES).c_str(), WS_CHILD | WS_VISIBLE,			thirdcolPos + 125, horzSeparatorPos + 10, 50, 30, hWnd, (HMENU)IDC_EDIT_DISTANCE_THRES, GetModuleHandle(NULL), NULL);		//base/match image selector		check_box_handles[0] = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON", "Base Image", WS_CHILD | WS_VISIBLE | WS_GROUP | BS_AUTORADIOBUTTON,			vertSeparatorPos + 10, horzSeparatorPos + 50, 165, 30, hWnd, (HMENU)IDC_CHECK_BOX_BASE, GetModuleHandle(NULL), NULL);		check_box_handles[1] = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON", "Match Image", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,			vertSeparatorPos + 10, horzSeparatorPos + 90, 165, 30, hWnd, (HMENU)IDC_CHECK_BOX_MATCH, GetModuleHandle(NULL), NULL);		//merge checkbox		merge_checkbox_handle = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON", "Merge Match to Base", WS_CHILD | BS_AUTOCHECKBOX,			thirdcolPos + 10, horzSeparatorPos + 50, 165, 30, hWnd, (HMENU)IDC_CHECK_BOX_MERGE, GetModuleHandle(NULL), NULL);		//base/match image selector		check_box_handles[2] = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON", "Park", WS_CHILD | WS_VISIBLE | WS_GROUP | BS_AUTORADIOBUTTON,			thirdcolPos + 10, horzSeparatorPos + 50, 80, 30, hWnd, (HMENU)IDC_CHECK_BOX_PARK, GetModuleHandle(NULL), NULL);		check_box_handles[3] = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON", "Leave", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,			thirdcolPos + 95, horzSeparatorPos + 50, 80, 30, hWnd, (HMENU)IDC_CHECK_BOX_LEAVE, GetModuleHandle(NULL), NULL);		//change spot		CreateWindowEx(WS_EX_TRANSPARENT, "Static", "New Spot:", WS_CHILD | WS_VISIBLE,			thirdcolPos + 10, horzSeparatorPos + 90, 110, 30, hWnd, (HMENU)IDC_STATIC_SPOT, GetModuleHandle(NULL), NULL);		spot_handle = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE,			thirdcolPos + 125, horzSeparatorPos + 90, 50, 30, hWnd, (HMENU)IDC_EDIT_SPOT, GetModuleHandle(NULL), NULL);		//navigator		leftnavi_button_handle = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "<---", WS_CHILD | WS_VISIBLE,			vertSeparatorPos + 100 - 80, horzSeparatorPos + 130, 80, 40, hWnd, (HMENU)IDC_BUTTON_LEFT, GetModuleHandle(NULL), NULL);		rightnavi_button_handle = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "--->", WS_CHILD | WS_VISIBLE,			vertSeparatorPos + 185 - 80, horzSeparatorPos + 130, 80, 40, hWnd, (HMENU)IDC_BUTTON_RIGHT, GetModuleHandle(NULL), NULL);		//save review result		save_button_handle = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "SAVE", WS_CHILD | WS_VISIBLE,			vertSeparatorPos + 275, horzSeparatorPos + 130, 80, 40, hWnd, (HMENU)IDC_BUTTON_SAVE, GetModuleHandle(NULL), NULL);		horzSeparatorPos += 175;		CreateWindowEx(WS_EX_CLIENTEDGE, "Static", "", SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 5, horzSeparatorPos, 535, 10, hWnd, NULL, GetModuleHandle(NULL), NULL);				CreateWindowEx(WS_EX_TRANSPARENT, "Static", "Latest Logs:", WS_CHILD | WS_VISIBLE,			10, horzSeparatorPos + 10, 515, 30, hWnd, (HMENU)IDC_STATIC_RESULT, GetModuleHandle(NULL), NULL);		result_handle = CreateWindowEx(WS_EX_TRANSPARENT, "STATIC", " Waiting for configurting the output file!", WS_CHILD | WS_VISIBLE,			10, horzSeparatorPos + 40, 515, 110, hWnd, (HMENU)IDC_EDIT_RESULT, GetModuleHandle(NULL), NULL);		EnableAllInteractions(false);		// Gets Menu Handle		menu_handle = GetMenu(hWnd);		CheckMenuItem(menu_handle, IDM_PLAY_MOV, MF_CHECKED);			}	break;	// press left mouse button somewhere in the main window to uncheck all radiobuttons (optionbuttons)	case WM_LBUTTONDOWN:	{		if (BST_CHECKED == SendMessage(check_box_handles[0], BM_GETCHECK, 0, 0)){			if (showClearTutorial){				int ret = MessageBox(hWnd, "Enable the function to clear park/leave radio when clicking the background or a non-active component?", "You just clicked the background or a non-active component", MB_YESNO);				showClearTutorial = false;				enableClear = (ret == IDYES);			}		}				if (enableClear){			SendMessage(check_box_handles[2], BM_SETCHECK, BST_UNCHECKED, 0);			SendMessage(check_box_handles[3], BM_SETCHECK, BST_UNCHECKED, 0);		}	}	break;	case WM_KEYDOWN:	{		int x = 0;		switch (wParam)		{		case VK_LEFT:			HandleMovement(-1);			break;		case VK_RIGHT:			HandleMovement(+1);			break;		}	}	break;	case WM_DESTROY:		vio->Stop_Video();		DestroyImage(BASE_TYPE);		DestroyImage(MATCH_TYPE);		closeOutputFile();		PostQuitMessage(0);		break;	default:		return DefWindowProc(hWnd, message, wParam, lParam);	}	return 0;}
开发者ID:liuruilinspy,项目名称:vehicleTrackingReview,代码行数:101,


示例14: dc

void COpenCVInterfaceDlg::OnPaint(){	CPaintDC dc(this); // device context for painting	//In variabila r1 pastrez dimensiunile ferestrei picture1	CRect r1;	GetClientRect(&r1);	int w,h;	if(mainImage.cols)	{		//aleg minimul dintre dimensiunile imag si ale ferestrei de afisare		if(mainImage.cols<r1.Width()) w=mainImage.cols;		else w=r1.Width();		if(mainImage.rows<r1.Height()) h=mainImage.rows;		else h=r1.Height();		//creez un dreptunghi cu dimensiunile minime si il umplu cu peria imagine		CRect r(0,0,w-1,h-1);		dc.FillRect(r,ImageBrush);		CMenu* mmenu =GetMenu();		CMenu* submenu =mmenu->GetSubMenu(1);		UINT state = submenu->GetMenuState(ID_TOOLS_GRAYLEVELROW,MF_BYCOMMAND);		UINT state1 = submenu->GetMenuState(ID_TOOLS_GRAYLEVELCOLUMN,MF_BYCOMMAND);		ASSERT(state != 0xFFFFFFFF);		ASSERT(state1 != 0xFFFFFFFF);		if(state & MF_CHECKED)		{ 			if(gr->GetY()<mainImage.rows)			{				gr->setGCheck(true);				CPen *pen = new CPen(PS_SOLID,1,RGB(255,0,0));				CPen *oldPen;				oldPen=(CPen*)dc.SelectObject(pen);				dc.MoveTo(0,gr->GetY());				dc.LineTo(mainImage.cols,gr->GetY());				dc.SelectObject(oldPen);				delete pen;			}		}		else		{			if(state1 & MF_CHECKED)			{				gr->setGCheck(false);				if(gr->GetX()<mainImage.cols)				{					CPen *pen = new CPen(PS_SOLID,1,RGB(255,0,0));					CPen *oldPen;					oldPen=(CPen*)dc.SelectObject(pen);					dc.MoveTo(gr->GetX(),0);					dc.LineTo(gr->GetX(),mainImage.rows);					dc.SelectObject(oldPen);					delete pen;				}			}		}	}}
开发者ID:alduleacristi,项目名称:proiect-procesare-imagini,代码行数:62,


示例15: MainWindowProc

/* * WindowProc - main window message handler */LONG CALLBACK MainWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ){    WORD                        cmd;    about_info                  ai;    HMENU                       mh;    CommunicationBuffer         *dbginfo;    switch ( msg ) {    case WM_CREATE:        setupSystemMenu( hwnd );        MainLBox = CreateListBox( hwnd );        mh = GetMenu( hwnd );        if( ConfigData.auto_attatch ) {            CheckMenuItem( mh, MENU_AUTO_ATTATCH, MF_BYCOMMAND | MF_CHECKED );        }        if( ConfigData.continue_exception ) {            CheckMenuItem( mh, MENU_EXCEPTION_CONTINUE,                                MF_BYCOMMAND | MF_CHECKED );        }        LBPrintf( MainLBox, STR_DRNT_STARTED, AppName );        break;    case WM_SIZE:        MoveListBox( MainLBox, 0, 0, LOWORD( lparam ), HIWORD( lparam ) );        ClearAlert();        break;    case WM_SYSCOMMAND:        switch( wparam ) {        case MENU_LOG_CURRENT_STATE:        case MENU_LOG_OPTIONS:        case MENU_TASK_CTL:            SendMessage( hwnd, WM_COMMAND, wparam, 0 );            break;        default:            return( DefWindowProc( hwnd, msg, wparam, lparam ) );        }        break;    case WM_COMMAND:        cmd = LOWORD( wparam );        switch( cmd ) {        case LISTBOX_1:            break;        case MENU_EXCEPTION_CONTINUE:            ConfigData.continue_exception = !ConfigData.continue_exception;            mh = GetMenu( hwnd );            if( ConfigData.continue_exception ) {                CheckMenuItem( mh, MENU_EXCEPTION_CONTINUE,                                   MF_BYCOMMAND | MF_CHECKED );            } else {                CheckMenuItem( mh, MENU_EXCEPTION_CONTINUE,                                   MF_BYCOMMAND | MF_UNCHECKED );            }            break;        case MENU_LOG_VIEW:            ViewLog();            break;        case MENU_NEW_TASK:            CallProcCtl( MENU_NEW_TASK, NULL, NULL );            break;        case MENU_AUTO_ATTATCH:            ConfigData.auto_attatch = ! ConfigData.auto_attatch;            mh = GetMenu( hwnd );            if( ConfigData.auto_attatch ) {                CheckMenuItem( mh, MENU_AUTO_ATTATCH,                               MF_BYCOMMAND | MF_CHECKED );            } else {                CheckMenuItem( mh, MENU_AUTO_ATTATCH,                               MF_BYCOMMAND | MF_UNCHECKED );            }            break;        case MENU_SHOW_DIP_STATUS:            ShowDIPStatus( hwnd );            break;        case MENU_CLEAR:            ClearListBox( MainLBox );            break;        case MENU_SAVE_AS:            SaveListBox( SLB_SAVE_AS, SaveExtra, "", AppName, hwnd,                         GetListBoxHwnd( MainLBox ) );            break;        case MENU_SAVE:            SaveListBox( SLB_SAVE_TMP, SaveExtra, ".//drwat.txt", AppName,                         hwnd, GetListBoxHwnd( MainLBox ) );            break;        case MENU_FONT:            if( ChooseMonoFont( hwnd ) ) {                SetListBoxFont( MainLBox );            }            break;        case MENU_MARK:            ProcessMark( hwnd, Instance, MarkPrint );            break;        case MENU_ABOUT:            ai.owner = hwnd;            ai.inst = Instance;            ai.name = AllocRCString( STR_ABOUT_NAME );            ai.version = AllocRCString( STR_ABOUT_VERSION );            ai.first_cr_year = "1993";//.........这里部分代码省略.........
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:101,


示例16: mainWinProc

// The Main Window ProcedureLRESULT CALLBACK mainWinProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){    switch(msg)    {        case WM_CTLCOLORSTATIC:     // Give Color Values to Buttons etc            {               // if ((HWND)lParam == standByChBox) // Check the button                hBrushColor = CreateSolidBrush(RGB(255, 255, 255)); // White background is returned                SetTextColor((HDC)wParam, RGB(0, 0, 0));            // Black foreground for text                //SetTextColor((HDC)wParam, RGB(0x99, 0xB4, 0xD1));                SetBkColor((HDC)wParam, RGB(255, 255, 255));        // White background for text                // Background color that is used to repaint the control (doesn't affect text background)                return (LRESULT)hBrushColor;            }////                RECT desktopRect,thisWindowRect;////////                GetWindowRect(GetDesktopWindow(), &desktopRect);////                GetWindowRect(hwnd, &thisWindowRect);////////                // Set the destination rect to the lower right corner of the screen////                desktopRect.left = desktopRect.right;////                desktopRect.top = desktopRect.bottom;////////                // Animate////                DrawAnimatedRects(hwnd, IDANI_CAPTION, &thisWindowRect, &desktopRect);////        case WM_SYSCOMMAND:            switch ( LOWORD(wParam) )            {                case SC_MINIMIZE:  // Minimize Button                    if (g_minToTray) // Minimize to Tray                    {                        // Show the notification icon                        Shell_NotifyIcon(NIM_ADD,&notifyID);                        // Hide the window                        ShowWindow(hwnd,SW_HIDE);                        return 0;                    }                    else // Regular Minimaze                        return DefWindowProc(hwnd, msg, wParam, lParam);                    break;                default:                    return DefWindowProc(hwnd, msg, wParam, lParam);            }            break;        case WM_TRAYICON:                if ( lParam == WM_LBUTTONDBLCLK )                {                   // Remove the icon from the system tray                  Shell_NotifyIcon(NIM_DELETE, &notifyID);                  // ..and show the window                  ShowWindow(hwnd, SW_SHOW);                  return 0;                }//                else if (lParam == WM_RBUTTONDOWN)//                {//                  // CASE CONTEXT MENU////                }                //return 0;            //}            break;        case WM_COMMAND:    // Menu Command            switch(LOWORD(wParam))            {                case ID_STANDBY_CHBOX: // Get standByChBox state                    if ( IsDlgButtonChecked( hwnd, ID_STANDBY_CHBOX )== BST_CHECKED )                         setExecState(hwnd, 1);                    else setExecState(hwnd, 0);                    break;                case ID_NOSLEEP_CHBOX: // Get noSleepChBox state                {                    BOOL ch1,ch2;                    if ( IsDlgButtonChecked( hwnd, ID_STANDBY_CHBOX )== BST_CHECKED ) ch1=true;                    else ch1=false;                    if ( IsDlgButtonChecked( hwnd, ID_NOSLEEP_CHBOX )== BST_CHECKED ) ch2=true;                    else ch2=false;                    if ( ch1 && ch2 )                        setExecState(hwnd, 2);                    else                        if ( ch1 && !ch2 )                            setExecState(hwnd, 1);                        else setExecState(hwnd, 0);                    break;                }                case ID_SETTINGS_MINTOTRAY: // Chenge menu item check state                    {                        HMENU mainMenu = GetMenu(hwnd);                        UINT checkUncheck = (g_minToTray ? MF_UNCHECKED : MF_CHECKED);                        CheckMenuItem(mainMenu, ID_SETTINGS_MINTOTRAY, checkUncheck);                        g_minToTray = !g_minToTray;                    }//.........这里部分代码省略.........
开发者ID:ridelub,项目名称:PreventStandBy,代码行数:101,


示例17: WinMain

int WINAPI WinMain(	HINSTANCE hinstance,					HINSTANCE hprevinstance,					LPSTR lpcmdline,					int ncmdshow){// this is the winmain functionWNDCLASS winclass;	// this will hold the class we createHWND	 hwnd;		// generic window handleMSG		 msg;		// generic messageHDC      hdc;       // generic dcPAINTSTRUCT ps;     // generic paintstruct// first fill in the window class stucturewinclass.style			= CS_DBLCLKS | CS_OWNDC |                           CS_HREDRAW | CS_VREDRAW;winclass.lpfnWndProc	= WindowProc;winclass.cbClsExtra		= 0;winclass.cbWndExtra		= 0;winclass.hInstance		= hinstance;winclass.hIcon			= LoadIcon(NULL, IDI_APPLICATION);winclass.hCursor		= LoadCursor(NULL, IDC_ARROW);winclass.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);winclass.lpszMenuName	= NULL; winclass.lpszClassName	= WINDOW_CLASS_NAME;// register the window classif (!RegisterClass(&winclass))	return(0);// create the window, note the test to see if WINDOWED_APP is// true to select the appropriate window flagsif (!(hwnd = CreateWindow(WINDOW_CLASS_NAME, // class						  WINDOW_TITLE,	 // title						  (WINDOWED_APP ? (WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION) : (WS_POPUP | WS_VISIBLE)),					 	  0,0,	   // x,y						  WINDOW_WIDTH,  // width                          WINDOW_HEIGHT, // height						  NULL,	   // handle to parent 						  NULL,	   // handle to menu						  hinstance,// instance						  NULL)))	// creation parmsreturn(0);// save the window handle and instance in a globalmain_window_handle = hwnd;main_instance      = hinstance;// resize the window so that client is really width x heightif (WINDOWED_APP){// now resize the window, so the client area is the actual size requested// since there may be borders and controls if this is going to be a windowed app// if the app is not windowed then it won't matterRECT window_rect = {0,0,WINDOW_WIDTH-1,WINDOW_HEIGHT-1};// make the call to adjust window_rectAdjustWindowRectEx(&window_rect,     GetWindowStyle(main_window_handle),     GetMenu(main_window_handle) != NULL,      GetWindowExStyle(main_window_handle));// save the global client offsets, they are needed in DDraw_Flip()window_client_x0 = -window_rect.left;window_client_y0 = -window_rect.top;// now resize the window with a call to MoveWindow()MoveWindow(main_window_handle,           0, // x position           0, // y position           window_rect.right - window_rect.left, // width           window_rect.bottom - window_rect.top, // height           FALSE);// show the window, so there's no garbage on first renderShowWindow(main_window_handle, SW_SHOW);} // end if windowed// perform all game console specific initializationGame_Init();// disable CTRL-ALT_DEL, ALT_TAB, comment this line out // if it causes your system to crashSystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, NULL, 0);// enter main event loopwhile(1)	{	if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))		{ 		// test if this is a quit        if (msg.message == WM_QUIT)           break;			// translate any accelerator keys		TranslateMessage(&msg);		// send the message to the window proc		DispatchMessage(&msg);		} // end if//.........这里部分代码省略.........
开发者ID:giantchen2012,项目名称:tricks-of-the-3d-game-programming-gurus,代码行数:101,


示例18: wWinMain

int PASCAL wWinMain(HINSTANCE hInstC, HINSTANCE hInstP, LPWSTR lpCmdLine, int nCmdShow){    MSG msg={0};    WNDCLASS wc;    // Initialize COM    if(FAILED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))    {        Msg(TEXT("CoInitialize Failed!/r/n"));        return FALSE;    }    // Verify that the VMR is present on this system    if(!VerifyVMR9())        return FALSE;    // Was a filename specified on the command line?    if(lpCmdLine[0] != '/0')    {        (void)StringCchCopy(g_szFileName, NUMELMS(g_szFileName), lpCmdLine);    }    // Set initial media state    g_psCurrent = Init;    // Register the window class    ZeroMemory(&wc, sizeof wc);    ghInst = wc.hInstance = hInstC;    wc.lpfnWndProc   = WndMainProc;    wc.lpszClassName = CLASSNAME;    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU);    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);    wc.hIcon         = NULL;    if(!RegisterClass(&wc))    {        Msg(TEXT("RegisterClass Failed! Error=0x%x/r/n"), GetLastError());        CoUninitialize();        exit(1);    }    // Create the main window.  The WS_CLIPCHILDREN style is required.    ghApp = CreateWindow(CLASSNAME, APPLICATIONNAME,                         WS_OVERLAPPEDWINDOW | WS_CAPTION | WS_CLIPCHILDREN | WS_VISIBLE,                         CW_USEDEFAULT, CW_USEDEFAULT,                         DEFAULT_AUDIO_WIDTH, DEFAULT_AUDIO_HEIGHT,                         0, 0, ghInst, 0);    if(ghApp)    {        // Save menu handle for later use        ghMenu = GetMenu(ghApp);        EnablePlaybackMenu(FALSE);        // If a media file was specified on the command line, open it now.        // (If the first character in the string isn't NULL, post an open clip message.)        if (g_szFileName[0] != 0)            PostMessage(ghApp, WM_COMMAND, ID_FILE_OPENCLIP, 0);        // Main message loop        while(GetMessage(&msg,NULL,0,0))        {            TranslateMessage(&msg);            DispatchMessage(&msg);        }    }    else    {        Msg(TEXT("Failed to create the main window! Error=0x%x/r/n"), GetLastError());    }    // Finished with COM    CoUninitialize();    return (int) msg.wParam;}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:75,


示例19: WndProc

//// This is the Window Procedure for handling windows messages//LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){     PAINTSTRUCT ps ;     static RECT  rect ;                // region of client window     static HMENU hMenu;                // handle to menu     static INT currentSelection = 0;   // current menu selection     static int x=0, y=0;     static HWND   hButton[4];         // the button windows     static HWND   hButtonICE;         // the "ICE" Button	 static HDC hdc;	 HRGN   hRgn;   // region to allow for drawing           switch (message)     {     case WM_CREATE:		         GetClientRect(hwnd, &rect);        		 		 		 hButton[0] = CreateWindow(TEXT("BUTTON"), 				 TEXT("1"), 				 WS_CHILD| WS_VISIBLE | BS_AUTORADIOBUTTON,                 100,80,30,200,				 hwnd, (HMENU)(ID_SELECTSTICK_STICK1 ), 				 ((LPCREATESTRUCT)lParam)->hInstance,				 NULL);		 hButton[1] = CreateWindow(TEXT("BUTTON"), 				 TEXT("2"), 				 WS_CHILD| WS_VISIBLE | BS_AUTORADIOBUTTON,                 140,280,200,30,				 hwnd, (HMENU)(ID_SELECTSTICK_STICK2), 				 ((LPCREATESTRUCT)lParam)->hInstance,				 NULL);		 hButton[2] = CreateWindow(TEXT("BUTTON"), 				 TEXT("3"), 				 WS_CHILD | WS_VISIBLE | BS_CENTER | BS_AUTORADIOBUTTON,                 340,80,30,200,				 hwnd, (HMENU)(ID_SELECTSTICK_STICK3 ), 				 ((LPCREATESTRUCT)lParam)->hInstance,				 NULL);		 hButton[3] = CreateWindow(TEXT("BUTTON"), 				 TEXT("4"), 				 WS_CHILD |WS_VISIBLE | BS_AUTORADIOBUTTON,                 215,320,30,200,				 hwnd, (HMENU)(ID_SELECTSTICK_STICK4), 				 ((LPCREATESTRUCT)lParam)->hInstance,				 NULL);		 		 // fill end here         // Initialize menu and button selections.	     hMenu = GetMenu(hwnd);                     // handle to menu         currentSelection = ID_BASE;                // start with cheese         CheckMenuItem(hMenu, currentSelection, MF_CHECKED);    // check menu         SendMessage(hButton[currentSelection-ID_BASE], BM_SETCHECK, 1,0); // check button         // Create the "ICE" push button         hButtonICE = CreateWindow(TEXT("BUTTON"),          // button class				 TEXT("ICE"),                               // window name				 WS_CHILD | WS_VISIBLE | BS_MULTILINE | BS_PUSHBUTTON,     // pushbutton style child window                 210,200,									// location bottom right				 50,50,				 hwnd, (HMENU) ID_ICE,                     // unique child window id				 ((LPCREATESTRUCT)lParam)->hInstance,				 NULL);		 wpOriginalWndProc = (WNDPROC) SetWindowLong(hButtonICE,   // subclass to use ICE proc			                GWL_WNDPROC, (LONG) NewButtonWndProc);  // to take over original wndproc 		 		 return 0;	 case WM_RBUTTONDOWN:		 // Get position of cursor when right-click happened. 		 // Call GetClientRect() to get dimensions of the stick.		 // Call MoveWindow() to move to new position				 // fill start here				 x =  GET_X_LPARAM(lParam);   		 y =  GET_Y_LPARAM(lParam);		 GetWindowRect (hButton[currentSelection-ID_BASE], &rect);				 MoveWindow(hButton[currentSelection-ID_BASE], x, y, rect.right-rect.left, rect.bottom-rect.top, true);		 // fill end here         return 0;	 case WM_CHAR: 		 // WM_CHAR is generated when keyboard character is pressed.		 // This message is sent to the window that has focus, or the		 // default active/parent window.  //.........这里部分代码省略.........
开发者ID:chapmanc,项目名称:term3,代码行数:101,


示例20: GetSubMenu

void CMainFrame::OnCreate(WPARAM wParam, LPARAM lParam){  // Create MDI client window  CLIENTCREATESTRUCT ccs;  ccs.hWindowMenu = GetSubMenu(GetMenu(m_hWnd), 5);  ccs.idFirstChild = 3;  m_hClient = CreateWindow("MDICLIENT", NULL, WS_CHILD | WS_VISIBLE |      WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL,      0, 0, 0, 0, m_hWnd, (HMENU)IDR_CLIENT, NULL, &ccs);   // Create status bar  m_hStatus = CreateStatusWindow(WS_VISIBLE | WS_CHILD | SBARS_SIZEGRIP,      "Stopped", m_hWnd, IDR_STATUS);  // Create rebar  m_hRebar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL,      WS_CHILD | WS_VISIBLE |WS_BORDER| WS_CLIPSIBLINGS | WS_CLIPCHILDREN |      RBS_VARHEIGHT | CCS_NODIVIDER | RBS_AUTOSIZE | RBS_VARHEIGHT |      RBS_BANDBORDERS, 0, 0, 0, 0, m_hWnd, (HMENU)IDR_REBAR, NULL,      NULL);  // Initialize rebar  REBARINFO rbi;  rbi.cbSize = sizeof(REBARINFO);  ZeroMemory(&rbi, sizeof(REBARINFO));  SendMessage(m_hRebar, RB_SETBARINFO, 0, (LPARAM)&rbi);  // Load toolbar from resource  m_hToolbar = LoadToolbar(NULL, TBSTYLE_FLAT | TBSTYLE_WRAPABLE |      CCS_NODIVIDER |CCS_NOPARENTALIGN | CCS_NORESIZE , IDR_TOOLBAR, m_hRebar);    // Insert toolbar into rebar  SIZE size;  REBARBANDINFO rbbi;  SendMessage(m_hToolbar, TB_GETMAXSIZE, 0, (LPARAM)&size);  ZeroMemory(&rbbi, sizeof(REBARBANDINFO));  rbbi.cbSize     = sizeof(REBARBANDINFO);  rbbi.fMask      = RBBIM_CHILD| RBBIM_CHILDSIZE | RBBIM_STYLE;  rbbi.fStyle     = RBBS_GRIPPERALWAYS;   rbbi.hwndChild  = m_hToolbar;  rbbi.cxMinChild = size.cx;  rbbi.cyMinChild = size.cy;  SendMessage(m_hRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbbi);  // TODO: Load and set window icon  m_hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_APP));  SendMessage(m_hWnd, WM_SETICON, ICON_SMALL, (LPARAM)m_hIcon);  SendMessage(m_hWnd, WM_SETICON, ICON_BIG, (LPARAM)m_hIcon);  // Open command argument file if exists and valid  if (__argc == 2)  {    // Create default model window    m_pMainWnd = new CModelView(this, new CModelDoc);    // Assign file name    m_sFileName = __argv[1];    // Open target file    fstream file;    file.open(__argv[1], ios::in|ios::binary);    // Load data from file    if (m_pMainWnd->m_pDocument->Load(&file) == FALSE)    {      // If error, clean file name      m_sFileName.clear();      // Create the window      m_pMainWnd->Create("Root Document", m_hClient);      // Release error data      m_pMainWnd->OnDestroy(0, 0);      m_pMainWnd = NULL;    }    else    {      // Create the window      m_pMainWnd->Create("Root Document", m_hClient);      // Compile blocks      m_pMainWnd->m_pDocument->Compile();      // Update document      m_pMainWnd->m_pDocument->Update();      m_pMainWnd->m_pDocument->Check();      // Update window      InvalidateRect(m_pMainWnd->m_hWnd, NULL, TRUE);    }    // End of file operating    file.close();  }}
开发者ID:neuks,项目名称:Synaptics,代码行数:96,


示例21: UpdateMenus

	void UpdateMenus()	{		HMENU menu = GetMenu(GetHWND());#define CHECKITEM(item,value) 	CheckMenuItem(menu,item,MF_BYCOMMAND | ((value) ? MF_CHECKED : MF_UNCHECKED));		CHECKITEM(ID_EMULATION_SPEEDLIMIT,g_Config.bSpeedLimit);//		CHECK(ID_OPTIONS_ENABLEFRAMEBUFFER,g_Config.bEnableFrameBuffer);//		CHECK(ID_OPTIONS_EMULATESYSCALL,g_bEmulateSyscall);		CHECKITEM(ID_OPTIONS_DISPLAYRAWFRAMEBUFFER, g_Config.bDisplayFramebuffer);		CHECKITEM(ID_OPTIONS_IGNOREILLEGALREADS,g_Config.bIgnoreBadMemAccess);		CHECKITEM(ID_CPU_INTERPRETER,g_Config.bJit == false);		CHECKITEM(ID_CPU_DYNAREC,g_Config.bJit == true);		CHECKITEM(ID_OPTIONS_BUFFEREDRENDERING, g_Config.bBufferedRendering);		CHECKITEM(ID_OPTIONS_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats);		CHECKITEM(ID_OPTIONS_HARDWARETRANSFORM, g_Config.bHardwareTransform);		CHECKITEM(ID_OPTIONS_FASTMEMORY, g_Config.bFastMemory);		CHECKITEM(ID_OPTIONS_SIMPLE2XSSAA, g_Config.SSAntiAliasing);		CHECKITEM(ID_OPTIONS_STRETCHDISPLAY, g_Config.bStretchToDisplay);		CHECKITEM(ID_EMULATION_RUNONLOAD, g_Config.bAutoRun);		CHECKITEM(ID_OPTIONS_USEVBO, g_Config.bUseVBO);		CHECKITEM(ID_OPTIONS_VERTEXCACHE, g_Config.bVertexCache);		CHECKITEM(ID_OPTIONS_SHOWFPS, g_Config.iShowFPSCounter);		CHECKITEM(ID_OPTIONS_FRAMESKIP, g_Config.iFrameSkip != 0);		CHECKITEM(ID_OPTIONS_MIPMAP, g_Config.bMipMap);		CHECKITEM(ID_OPTIONS_VSYNC, g_Config.iVSyncInterval != 0);		CHECKITEM(ID_OPTIONS_TOPMOST, g_Config.bTopMost);		CHECKITEM(ID_EMULATION_SOUND, g_Config.bEnableSound);		CHECKITEM(ID_TEXTURESCALING_DEPOSTERIZE, g_Config.bTexDeposterize);				static const int zoomitems[4] = {			ID_OPTIONS_SCREEN1X,			ID_OPTIONS_SCREEN2X,			ID_OPTIONS_SCREEN3X,			ID_OPTIONS_SCREEN4X,		};		for (int i = 0; i < 4; i++) {			CheckMenuItem(menu, zoomitems[i], MF_BYCOMMAND | ((i == g_Config.iWindowZoom - 1) ? MF_CHECKED : MF_UNCHECKED));		}		static const int texscalingitems[] = {			ID_TEXTURESCALING_OFF,			ID_TEXTURESCALING_2X,			ID_TEXTURESCALING_3X,			ID_TEXTURESCALING_4X,			ID_TEXTURESCALING_5X,		};		for (int i = 0; i < 5; i++) {			CheckMenuItem(menu, texscalingitems[i], MF_BYCOMMAND | ((i == g_Config.iTexScalingLevel-1) ? MF_CHECKED : MF_UNCHECKED));		}		static const int texscalingtypeitems[] = {			ID_TEXTURESCALING_XBRZ,			ID_TEXTURESCALING_HYBRID,			ID_TEXTURESCALING_BICUBIC,			ID_TEXTURESCALING_HYBRID_BICUBIC,		};		for (int i = 0; i < 4; i++) {			CheckMenuItem(menu, texscalingtypeitems[i], MF_BYCOMMAND | ((i == g_Config.iTexScalingType) ? MF_CHECKED : MF_UNCHECKED));		}		static const int texfilteringitems[] = {			ID_OPTIONS_TEXTUREFILTERING_AUTO,			ID_OPTIONS_NEARESTFILTERING,			ID_OPTIONS_LINEARFILTERING,			ID_OPTIONS_LINEARFILTERING_CG,		};		for (int i = 0; i < 4; i++) {			int texFilterLevel = i > 0? (g_Config.iTexFiltering - 1) : g_Config.iTexFiltering;			CheckMenuItem(menu, texfilteringitems[i], MF_BYCOMMAND | ((i == texFilterLevel) ? MF_CHECKED : MF_UNCHECKED));		}		UpdateCommands();	}
开发者ID:AnimeReference,项目名称:ppsspp,代码行数:73,


示例22: WndProc

//.........这里部分代码省略.........			Force_SearchWin = FALSE;			Force_SearchSD = FALSE;			Onnormal(hWnd);			break;		case hard:			Force_SearchWin = FALSE;			Force_SearchSD = FALSE;			Onhard(hWnd);			break;		case Vhard:			Force_SearchWin = FALSE;			Force_SearchSD = FALSE;			OnVhard(hWnd);			break;		case Uhard:			Force_SearchWin = FALSE;			Force_SearchSD = FALSE;			OnUhard(hWnd);			break;		case AllWinLoss:			Force_SearchWin = TRUE;			OnAllSearchWin(hWnd);			break;		case AllStoneDiff:			Force_SearchSD = TRUE;			Force_SearchWin = FALSE;			OnAllSearchSD(hWnd);			break;*/		case book_switch:			if(!UseBook)			{				UseBook = TRUE;				m_FlagBook = TRUE;				HMENU hMenu = GetMenu(hWnd);				CheckMenuItem(hMenu, book_switch, MFS_CHECKED);			}			else			{				UseBook = FALSE;				m_FlagBook = FALSE;				HMENU hMenu = GetMenu(hWnd);				CheckMenuItem(hMenu, book_switch, MFS_UNCHECKED);			}			break;		case book_best:			if(!b_Flag_not_change)			{				HMENU hMenu = GetMenu(hWnd);				UncheckedAll_BookMenu(hMenu);				b_Flag_not_change = TRUE;				CheckMenuItem(hMenu, book_best, MFS_CHECKED);			}			break;		case book_little_change:			if(!b_Flag_little_change)			{				HMENU hMenu = GetMenu(hWnd);				UncheckedAll_BookMenu(hMenu);				b_Flag_little_change = TRUE;				CheckMenuItem(hMenu, book_little_change, MFS_CHECKED);			}			break;		case book_change:			if(!b_Flag_change)			{				HMENU hMenu = GetMenu(hWnd);
开发者ID:kazura-utb,项目名称:KZReversi_Cpp,代码行数:67,


示例23: QTFrame_FrameWndProc

LRESULT CALLBACK QTFrame_FrameWndProc (HWND theWnd, UINT theMessage, UINT wParam, LONG lParam){	HWND       			myChild;	switch (theMessage) {			case WM_CREATE: {			CLIENTCREATESTRUCT		myClientStruct = {0};			myClientStruct.hWindowMenu  = GetSubMenu(GetMenu(theWnd), WINDOWMENU);			myClientStruct.idFirstChild = IDM_WINDOWCHILD;						// create the MDI client filling the client area			ghWndMDIClient = CreateWindow("mdiclient",										 NULL,										 WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,										 0, 0, 0, 0,										 theWnd,										 (HMENU)0xCAC,										 ghInst,										 (LPVOID)&myClientStruct);						// set initial menu state			QTFrame_AdjustMenus(NULL, GetMenu(theWnd), 0L);						if (ghWndMDIClient != NULL)				ShowWindow(ghWndMDIClient, SW_SHOW);						return(0);		}		case WM_ACTIVATE:			// the MDI frame window is being activated or deactivated;			// activate or deactivate any active child window by sending this message to DefMDIChildProc 			myChild = (HWND)SendMessage(ghWndMDIClient, WM_MDIGETACTIVE, 0, 0L);			if (IsWindow(myChild))				SendMessage(myChild, WM_ACTIVATE, wParam, lParam);			break;		case WM_COMMAND: {			switch (LOWORD(wParam)) {				case IDM_FILENEW:				case IDM_FILEOPEN:				case IDM_FILECLOSE:				case IDM_EXIT:					QTFrame_HandleFileMenuItem(NULL, LOWORD(wParam));					return(0);				case IDM_FILESAVE:				case IDM_FILESAVEAS:					// save the active child window					myChild = (HWND)SendMessage(ghWndMDIClient, WM_MDIGETACTIVE, 0, 0L);					if (IsWindow(myChild))						SendMessage(myChild, WM_COMMAND, wParam, lParam);					return(0);				case IDM_WINDOWTILE:					SendMessage(ghWndMDIClient, WM_MDITILE, 0, 0L);					return(0);				case IDM_WINDOWCASCADE:					SendMessage(ghWndMDIClient, WM_MDICASCADE, 0, 0L);					return(0);				case IDM_WINDOWICONS:					SendMessage(ghWndMDIClient, WM_MDIICONARRANGE, 0, 0L);					return(0);				case IDM_WINDOWCLOSEALL: {					WindowReference		myWindow, myNextWindow;								// walk the window list and destroy any open windows					myWindow = QTFrame_GetFrontMovieWindow();					while (myWindow != NULL) {						myNextWindow = QTFrame_GetNextMovieWindow(myWindow);						SendMessage(myWindow, WM_CLOSE, 0L, 0L);						myWindow = myNextWindow;					}										return(0);				}				case IDM_ABOUT:					QTFrame_ShowAboutBox();					return(0);				default:									// pass this message to the active child window...					myChild = (HWND)SendMessage(ghWndMDIClient, WM_MDIGETACTIVE, 0, 0L);					if (IsWindow(myChild))						SendMessage(myChild, WM_COMMAND, wParam, lParam);					// ...then do any application-specific menu handling, if no movie windows are open...					if (myChild == NULL)						QTApp_HandleMenu((UInt16)LOWORD(wParam));										// ...and then pass it to DefFrameProc					break;			}//.........这里部分代码省略.........
开发者ID:fruitsamples,项目名称:qtbigscreen,代码行数:101,


示例24: disasmbasewin_info

consolewin_info::consolewin_info(debugger_windows_interface &debugger) :	disasmbasewin_info(debugger, true, "Debug", NULL),	m_devices_menu(NULL){	if ((window() == NULL) || (m_views[0] == NULL))		goto cleanup;	// create the views	m_views[1].reset(global_alloc(debugview_info(debugger, *this, window(), DVT_STATE)));	if (!m_views[1]->is_valid())		goto cleanup;	m_views[2].reset(global_alloc(debugview_info(debugger, *this, window(), DVT_CONSOLE)));	if (!m_views[2]->is_valid())		goto cleanup;	{		// Add image menu only if image devices exist		image_interface_iterator iter(machine().root_device());		device_image_interface *img = iter.first();		if (img != NULL)		{			m_devices_menu = CreatePopupMenu();			for ( ; img != NULL; img = iter.next())			{				astring temp;				temp.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[no image]");				TCHAR *tc_buf = tstring_from_utf8(temp.c_str());				if (tc_buf != NULL)				{					AppendMenu(m_devices_menu, MF_ENABLED, 0, tc_buf);					osd_free(tc_buf);				}			}			AppendMenu(GetMenu(window()), MF_ENABLED | MF_POPUP, (UINT_PTR)m_devices_menu, TEXT("Images"));		}		// get the work bounds		RECT work_bounds, bounds;		SystemParametersInfo(SPI_GETWORKAREA, 0, &work_bounds, 0);		// adjust the min/max sizes for the window style		bounds.top = bounds.left = 0;		bounds.right = bounds.bottom = EDGE_WIDTH + m_views[1]->maxwidth() + (2 * EDGE_WIDTH) + 100 + EDGE_WIDTH;		AdjustWindowRectEx(&bounds, DEBUG_WINDOW_STYLE, FALSE, DEBUG_WINDOW_STYLE_EX);		set_minwidth(bounds.right - bounds.left);		bounds.top = bounds.left = 0;		bounds.right = bounds.bottom = EDGE_WIDTH + m_views[1]->maxwidth() + (2 * EDGE_WIDTH) + MAX(m_views[0]->maxwidth(), m_views[2]->maxwidth()) + EDGE_WIDTH;		AdjustWindowRectEx(&bounds, DEBUG_WINDOW_STYLE, FALSE, DEBUG_WINDOW_STYLE_EX);		set_maxwidth(bounds.right - bounds.left);		// position the window at the bottom-right		int const bestwidth = MIN(maxwidth(), work_bounds.right - work_bounds.left);		int const bestheight = MIN(500, work_bounds.bottom - work_bounds.top);		SetWindowPos(window(), HWND_TOP,					work_bounds.right - bestwidth, work_bounds.bottom - bestheight,					bestwidth, bestheight,					SWP_SHOWWINDOW);	}	// recompute the children	set_cpu(*debug_cpu_get_visible_cpu(machine()));	// mark the edit box as the default focus and set it	set_default_focus();	return;cleanup:	m_views[2].reset();	m_views[1].reset();	m_views[0].reset();}
开发者ID:relimited,项目名称:mame,代码行数:72,


示例25: RamWatchProc

LRESULT CALLBACK RamWatchProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){	RECT r;	RECT r2;	int dx1, dy1, dx2, dy2;	static int watchIndex=0;	Update_RAM_Watch();	switch(uMsg)	{		case WM_MOVE: {			RECT wrect;			GetWindowRect(hDlg,&wrect);			ramw_x = wrect.left;			ramw_y = wrect.top;			break;			};					case WM_INITDIALOG: {			GetWindowRect(MainWindow->getHWnd(), &r);  //Ramwatch window			dx1 = (r.right - r.left) / 2;			dy1 = (r.bottom - r.top) / 2;			GetWindowRect(hDlg, &r2); // Gens window			dx2 = (r2.right - r2.left) / 2;			dy2 = (r2.bottom - r2.top) / 2;						// push it away from the main window if we can			const int width = (r.right-r.left);			const int height = (r.bottom - r.top);			const int width2 = (r2.right-r2.left); 			if(r.left+width2 + width < GetSystemMetrics(SM_CXSCREEN))			{				r.right += width;				r.left += width;			}			else if((int)r.left - (int)width2 > 0)			{				r.right -= width2;				r.left -= width2;			}						//-----------------------------------------------------------------------------------			//If user has Save Window Pos selected, override default positioning			if (RWSaveWindowPos)				{				//If ramwindow is for some reason completely off screen, use default instead 				if (ramw_x > (-width*2) || ramw_x < (width*2 + GetSystemMetrics(SM_CYSCREEN))   ) 					r.left = ramw_x;	  //This also ignores cases of windows -32000 error codes				//If ramwindow is for some reason completely off screen, use default instead 				if (ramw_y > (0-height*2) ||ramw_y < (height*2 + GetSystemMetrics(SM_CYSCREEN))	)					r.top = ramw_y;		  //This also ignores cases of windows -32000 error codes			}			//-------------------------------------------------------------------------------------			SetWindowPos(hDlg, NULL, r.left, r.top, NULL, NULL, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);						ramwatchmenu=GetMenu(hDlg);			rwrecentmenu=CreateMenu();			UpdateRW_RMenu(rwrecentmenu, RAMMENU_FILE_RECENT, RW_MENU_FIRST_RECENT_FILE);						const char* names[3] = {"Address","Value","Notes"};			int widths[3] = {62,64,64+51+53};			init_list_box(GetDlgItem(hDlg,IDC_WATCHLIST),names,3,widths);/*			if (!ResultCount)  //TODO what do these do				reset_address_info();			else				signal_new_frame();*/			ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);//			if (!noMisalign) SendDlgItemMessage(hDlg, IDC_MISALIGN, BM_SETCHECK, BST_CHECKED, 0);//			if (littleEndian) SendDlgItemMessage(hDlg, IDC_ENDIAN, BM_SETCHECK, BST_CHECKED, 0);			RamWatchAccels = LoadAccelerators(hAppInst, MAKEINTRESOURCE(IDR_ACCELERATOR1));			// due to some bug in windows, the arrow button width from the resource gets ignored, so we have to set it here			SetWindowPos(GetDlgItem(hDlg,ID_WATCHES_UPDOWN), 0,0,0, 30,60, SWP_NOMOVE);			Update_RAM_Watch();			DragAcceptFiles(hDlg, TRUE);			RefreshWatchListSelectedCountControlStatus(hDlg);			return true;			break;		}				case WM_INITMENU:			CheckMenuItem(ramwatchmenu, RAMMENU_FILE_AUTOLOAD, AutoRWLoad ? MF_CHECKED : MF_UNCHECKED);			CheckMenuItem(ramwatchmenu, RAMMENU_FILE_SAVEWINDOW, RWSaveWindowPos ? MF_CHECKED : MF_UNCHECKED);			break;		case WM_MENUSELECT: 		case WM_ENTERSIZEMOVE:			break;		case WM_NOTIFY:		{			switch(wParam)			{				case ID_WATCHES_UPDOWN:				{//.........这里部分代码省略.........
开发者ID:snowasnow,项目名称:DeSmuME,代码行数:101,


示例26: UserHasMenu

BOOLUserHasMenu(HWND hWnd, ULONG Style){   return (!(Style & WS_CHILD) && GetMenu(hWnd) != 0);}
开发者ID:RPG-7,项目名称:reactos,代码行数:5,


示例27: CanvasProc

/*	FUNCTION: CanvasProc(HWND, UINT, WPARAM, LPARAM)	PURPOSE: Windows procedure for the canvas window	PARAMETERS:		hWnd	- window handle		message	- window message		wParam	- window message parameter (depends on message)		lParam	- window message parameter (depends on message)	RETURN:		If the message was processed, the return value is 0		If the message was not processed and passed to DefWindowProc		and the return value depends on the value of that function.*/LRESULT CALLBACK CanvasProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {	// a rectangle to hold current selection coords and a boolean to know whether we are in a drawing mode or not	static RECT		rect;	static POINT	pt[2];	static POINT	select;	static BOOL		fDrawing;	HMENU			hMenu;	// We'll be iterating through the list to find a selected object	pPROGRAM_ITEM	pListItem;	pPROGRAM_ITEM	pPrevItem;	hMenu = GetMenu(ghWndMain);	switch (message) {		case WM_CREATE: // case for when the window is created			SetRect(&rect, 0, 0, 0, 0); 			fDrawing = FALSE;			break;		case WM_MOUSEACTIVATE: // when the mouse moves into this window			SetFocus(hWnd);			return MA_ACTIVATE;			break;		case WM_LBUTTONDOWN:			if(fDrawing) { // this should not happen, but no harm checking				ReleaseCapture();			}			// start selecting			fDrawing = TRUE;			// mouse x and y in lParam			rect.left = (short)LOWORD(lParam);			rect.top = (short)HIWORD(lParam);			rect.right = (short)LOWORD(lParam);			rect.bottom = (short)HIWORD(lParam);			pt[0].x = (short)LOWORD(lParam);			pt[0].y = (short)HIWORD(lParam);			pt[1].x = (short)LOWORD(lParam);			pt[1].y = (short)HIWORD(lParam);			// draw first to keep drawing/erasing in synch.			// Check to see if we're drawing a line or a rectangle			if (GetMenuState(hMenu, ID_TOOLS_LINE, MF_BYCOMMAND) == MF_CHECKED) {				DrawLine(hWnd, (POINT *)&pt, gRGBCurrent, FALSE);			}			if (GetMenuState(hMenu, ID_TOOLS_RECTANGLE, MF_BYCOMMAND) == MF_CHECKED) {				DrawRect(hWnd, &rect, gRGBCurrent, FALSE);			}			SetCapture(hWnd);			return 0;		case WM_MOUSEMOVE:			if (fDrawing) {				RECT	rcClient;				GetClientRect(hWnd, &rcClient);								// Check to see if we're drawing a line or a rectangle				if (GetMenuState(hMenu, ID_TOOLS_LINE, MF_BYCOMMAND) == MF_CHECKED) {					// erase old selection					DrawLine(hWnd, (POINT *)&pt, gRGBCurrent, FALSE);				}				if (GetMenuState(hMenu, ID_TOOLS_RECTANGLE, MF_BYCOMMAND) == MF_CHECKED) {					// erase old selection					DrawRect(hWnd, &rect, gRGBCurrent, FALSE);				}				// mouse x and y in lParam				rect.right = (short)LOWORD(lParam);				rect.bottom = (short)HIWORD(lParam);				pt[1].x = (short)LOWORD(lParam);				pt[1].y = (short)HIWORD(lParam);				// make sure our selection does not go outside client area				if(rect.right < 0) {					rect.right = 0;					pt[1].x = 0;				}				if(rect.right > rcClient.right) {					rect.right = rcClient.right;//.........这里部分代码省略.........
开发者ID:AshuDassanRepo,项目名称:bcit-courses,代码行数:101,



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


C++ GetMenuCount函数代码示例
C++ GetMemoryPathEnable函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。