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


C++ CreatePopupMenu函数代码示例

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


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

示例1: BuildDownloadArray

int FCollectionMenu::ShowContextMenu(HWND hWndParent, const FArray<FString> &aVids)
{
	FArray<FDownload> aVideos; 
	size_t videoCount = BuildDownloadArray(aVideos, aVids); 

	if (videoCount == 0)
		return 0; 


	vidtype videoID = aVideos[0].m_Detail.m_VideoID; 
	FDownload &pVideo = aVideos[0];

	HMENU hmenu = CreatePopupMenu();
	int i = 0; 

	if (videoCount == 1 )
	{
		if (pVideo.m_dwFlags & FLAG_DOWNLOAD_FINISHED)
			_InsertMenuItem(hmenu, i++, miPlay, "Play");

		if (!pVideo.IsDownloadFinished())
		{
			if (pVideo.m_dwFlags & FLAG_DOWNLOAD_QUEUED )
				_InsertMenuItem(hmenu, i++, miStart, "Start Download");
			else
				_InsertMenuItem(hmenu, i++, miSuspend, pVideo.IsPaused() ? "Resume Download" : "Suspend Download");
		}
		else
		{
			if (pVideo.IsDownloadableStream())
				_InsertMenuItem(hmenu, i++, miStart, "Download Video");
		}

		_InsertMenuItem(hmenu, i++, miInfo, "Info...");
		_InsertMenuItem(hmenu, i++, miRename, "Rename");
	}

	_InsertMenuItem(hmenu, i++, miDelete, "Delete");
	_InsertMenuSeparator(hmenu, i++); 


	FLabels aAllLabels; 
	FLabels aCommonLabels; 
	BuildLabelsUnion(aVideos, aAllLabels, aCommonLabels); 

	HMENU hSub = CreateLabelsSubmenu(aCommonLabels, 100); 

	_InsertSubMenu(hmenu, i++, "Label", hSub); 

	if (videoCount == 1)
		_InsertMenuItem(hmenu, i++, miRevealFiles, "Reveal Files"); 

	BOOL bShowReveal = g_AppSettings.m_LogEnabled; 
#ifdef _DEBUG
	bShowReveal = TRUE; 
#endif

	if (bShowReveal)
		_InsertMenuItem(hmenu, i++, miRevealMTTI, "Reveal MTTI");

	POINT pt;
	GetCursorPos(&pt);

	int nCmd = TrackPopupMenu(hmenu, TPM_RETURNCMD, pt.x, pt.y, 0, hWndParent, NULL);

	if (nCmd < 100)
	{
		switch(nCmd)
		{
		case miPlay:
			g_MainFrame->PlayMediaFile(videoID); 
			break; 
		case miRename:
			{
				FString StrNewName = ShowRenameDlg(hWndParent, pVideo.m_Detail.m_VideoName);
				if (StrNewName != "")
				{
					pVideo.m_Detail.m_VideoName = StrNewName;
					g_Objects._DownloadManager.SaveVideoDetails(pVideo.GetVideoID(), pVideo.m_Detail); 
				}
			}
			break;

		case miSuspend:
			for (size_t k = 0; k < aVideos.GetCount(); k++)
			{
				FDownload& pVideo = aVideos[k];
				if (!pVideo.IsPaused())
					g_Objects._DownloadManager.PauseDownload(videoID); 
				else
					g_Objects._DownloadManager.ResumeDownload(videoID);
			}
			break; 
		case miDelete:
			for (size_t k = 0; k < aVideos.GetCount(); k++)
			{
				g_MainFrame->RemoveVideo(aVideos[k].m_Detail.m_VideoID);
				//g_Objects._DownloadManager.RemoveDownload(aVideos[k].m_Detail.m_VideoID); 
			}
			break; 
//.........这里部分代码省略.........
开发者ID:codeboost,项目名称:libertv,代码行数:101,代码来源:FCollectionMenu.cpp

示例2: OnFavTreeContextMenu

static void OnFavTreeContextMenu(WindowInfo* win, PointI pt) {
    TVITEM item;
    if (pt.x != -1 || pt.y != -1) {
        TVHITTESTINFO ht = {0};
        ht.pt.x = pt.x;
        ht.pt.y = pt.y;

        MapWindowPoints(HWND_DESKTOP, win->hwndFavTree, &ht.pt, 1);
        TreeView_HitTest(win->hwndFavTree, &ht);
        if ((ht.flags & TVHT_ONITEM) == 0)
            return; // only display menu if over a node in tree

        TreeView_SelectItem(win->hwndFavTree, ht.hItem);
        item.hItem = ht.hItem;
    } else {
        item.hItem = TreeView_GetSelection(win->hwndFavTree);
        if (!item.hItem) {
            return;
        }
        RECT rcItem;
        if (TreeView_GetItemRect(win->hwndFavTree, item.hItem, &rcItem, TRUE)) {
            MapWindowPoints(win->hwndFavTree, HWND_DESKTOP, (POINT*)&rcItem, 2);
            pt.x = rcItem.left;
            pt.y = rcItem.bottom;
        } else {
            WindowRect rc(win->hwndFavTree);
            pt = rc.TL();
        }
    }

    item.mask = TVIF_PARAM;
    TreeView_GetItem(win->hwndFavTree, &item);
    Favorite* toDelete = (Favorite*)item.lParam;

    HMENU popup = BuildMenuFromMenuDef(menuDefFavContext, dimof(menuDefFavContext), CreatePopupMenu());

    INT cmd = TrackPopupMenu(popup, TPM_RETURNCMD | TPM_RIGHTBUTTON, pt.x, pt.y, 0, win->hwndFavTree, nullptr);
    DestroyMenu(popup);
    if (IDM_FAV_DEL == cmd) {
        RememberFavTreeExpansionStateForAllWindows();
        if (toDelete) {
            DisplayState* f = gFavorites.GetByFavorite(toDelete);
            gFavorites.Remove(f->filePath, toDelete->pageNo);
        } else {
            // toDelete == nullptr => this is a parent node signifying all bookmarks in a file
            item.hItem = TreeView_GetChild(win->hwndFavTree, item.hItem);
            item.mask = TVIF_PARAM;
            TreeView_GetItem(win->hwndFavTree, &item);
            toDelete = (Favorite*)item.lParam;
            DisplayState* f = gFavorites.GetByFavorite(toDelete);
            gFavorites.RemoveAllForFile(f->filePath);
        }
        UpdateFavoritesTreeForAllWindows();
        prefs::Save();

        // TODO: it would be nice to have a system for undo-ing things, like in Gmail,
        // so that we can do destructive operations without asking for permission via
        // invasive model dialog boxes but also allow reverting them if were done
        // by mistake
    }
}
开发者ID:wyrover,项目名称:sumatrapdf,代码行数:61,代码来源:Favorites.cpp

示例3: PopupMenu

void CPsTree::PopupMenu()
{
	HMENU hPopup;
	MENUITEMINFO mii;
	TVHITTESTINFO hti;
	TVITEM tvi;
	POINT pt;
	int iItem, i;

	// init popup menu
	if (!(hPopup = CreatePopupMenu()))
		return;
	ZeroMemory(&mii, sizeof(MENUITEMINFO));
	mii.cbSize = sizeof(mii);
	mii.fMask = MIIM_STRING|MIIM_ID;

	// get cursor postion
	GetCursorPos(&pt);
	hti.pt = pt;
	ScreenToClient(_hWndTree, &hti.pt);

	tvi.mask = TVIF_PARAM|TVIF_CHILDREN;
	// find treeitem under cursor
	TreeView_HitTest(_hWndTree, &hti);
	if (hti.flags & (TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
		tvi.hItem = hti.hItem;
		TreeView_GetItem(_hWndTree, &tvi);

		if (!db_get_b(NULL, MODNAME, SET_PROPSHEET_READONLYLABEL, FALSE)) {
			mii.dwTypeData = TranslateT("Rename Item");
			mii.wID = 32001;
			InsertMenuItem(hPopup, 0, FALSE, &mii);
		}
		
		// do not allow hiding groups
		if (tvi.cChildren) {
			mii.fMask |= MIIM_STATE;
			mii.fState = MFS_DISABLED;
		}
		mii.dwTypeData = TranslateT("Hide Item");
		mii.wID = 32000;
		InsertMenuItem(hPopup, 0, FALSE, &mii);
	}
	else {
		// add hidden items to menu
		mii.wID = 0;
		for (i = 0; i < _numItems; i++) {
			if (!_pItems[i]->Hti()) {
				mii.dwTypeData = _pItems[i]->Label();
				mii.wID = 100 + i;
				InsertMenuItem(hPopup, 0, FALSE, &mii);
			}
		}
		// add headline
		if (mii.wID > 0) {
			mii.fMask |= MIIM_STATE;
			mii.fState = MFS_DISABLED;
			mii.dwTypeData = TranslateT("Show Items:");
			mii.wID = 0;
			InsertMenuItem(hPopup, 0, TRUE, &mii);
			mii.fMask |= MIIM_FTYPE;
			mii.fType = MFT_SEPARATOR;
			InsertMenuItem(hPopup, 1, TRUE, &mii);
			InsertMenuItem(hPopup, ++i, TRUE, &mii);
		}
		mii.fMask &= ~(MIIM_FTYPE|MIIM_STATE);
		mii.dwTypeData = TranslateT("Reset to defaults");
		mii.wID = 32004;
		InsertMenuItem(hPopup, ++i, TRUE, &mii);
	}
	// show the popup menu
	iItem = TrackPopupMenu(hPopup, TPM_RETURNCMD, pt.x, pt.y, 0, _hWndTree, NULL);
	DestroyMenu(hPopup);
	
	switch (iItem) {
		// hide the item
		case 32000:
			HideItem(tvi.lParam);
			break;
		// rename the item
		case 32001:
			BeginLabelEdit(tvi.hItem);
			break;
		// reset current tree
		case 32004:
			DBResetState();
			break;
		// show a hidden item
		default:
			if ((iItem -= 100) >= 0 && ShowItem(iItem, NULL))
				AddFlags(PSTVF_STATE_CHANGED|PSTVF_POS_CHANGED);
			break;
	}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:94,代码来源:classPsTree.cpp

示例4: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine, int nCmdShow)
{
	char *pb;
	char *pe;
	WNDCLASS wc;
	HWND hWnd;
	HMENU hMainMenu;
	MSG msg;

	for (pb = lpCmdLine; *pb == ' ' || *pb == '\t'; pb++);
	for (pe = pb; *pe != '\0'; pe++);
	while (--pe > pb && (*pe == ' ' || *pe == '\t'));
	/* Now pb and pe point at respectively the first and last
	   non-blank character in lpCmdLine. If pb > pe then the command line
	   is blank. */
	if (*pb == '"' && *pe == '"')
		pb++;
	else
		pe++;
	*pe = '\0';
	/* Now pb contains the filename, if any, specified on the command line. */

	hWnd = FindWindow(WND_CLASS_NAME, NULL);
	if (hWnd != NULL) {
		/* as instance of WASAP is already running */
		if (*pb != '\0') {
			/* pass the filename */
			COPYDATASTRUCT cds = { 'O', (DWORD) (pe + 1 - pb), pb };
			SendMessage(hWnd, WM_COPYDATA, (WPARAM) NULL, (LPARAM) &cds);
		}
		else {
			/* bring the open dialog to top */
			HWND hChild = GetLastActivePopup(hWnd);
			if (hChild != hWnd)
				SetForegroundWindow(hChild);
		}
		return 0;
	}

	wc.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;
	wc.lpfnWndProc = MainWndProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hInstance;
	wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APP));
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
	wc.lpszMenuName = NULL;
	wc.lpszClassName = WND_CLASS_NAME;
	RegisterClass(&wc);

	hWnd = CreateWindow(WND_CLASS_NAME,
		APP_TITLE,
		WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT,
		CW_USEDEFAULT,
		CW_USEDEFAULT,
		CW_USEDEFAULT,
		NULL,
		NULL,
		hInstance,
		NULL
	);

	hStopIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_STOP));
	hPlayIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PLAY));
	hMainMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_TRAYMENU));
	hTrayMenu = GetSubMenu(hMainMenu, 0);
	hSongMenu = CreatePopupMenu();
	InsertMenu(hTrayMenu, 1, MF_BYPOSITION | MF_ENABLED | MF_STRING | MF_POPUP,
	           (UINT_PTR) hSongMenu, "So&ng");
	hQualityMenu = GetSubMenu(hTrayMenu, 3);
	SetMenuDefaultItem(hTrayMenu, 0, TRUE);
	Tray_Add(hWnd, hStopIcon);
	SetQuality(hWnd, use_16bit, quality);
	if (*pb != '\0') {
		memcpy(strFile, pb, pe + 1 - pb);
		LoadFile(hWnd);
	}
	else
		SelectAndLoadFile(hWnd);
	while (GetMessage(&msg, NULL, 0, 0)) {
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	WaveOut_Close();
	Tray_Delete(hWnd);
	DestroyMenu(hMainMenu);
	return 0;
}
开发者ID:Erikhht,项目名称:TCPMP,代码行数:91,代码来源:wasap.c

示例5: WndProc

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
#if MENU_2
	case WM_CREATE:
		{
			HMENU hMenu, hSubMenu;
			HICON hIcon, hIconSm;
			
			hMenu = CreateMenu();
			//create submenu
			hSubMenu = CreatePopupMenu();
			AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
			AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");

			hSubMenu = CreatePopupMenu();
			AppendMenu(hSubMenu,MF_STRING,ID_STUFF_GO, "&Go");
			AppendMenu(hMenu,MF_STRING | MF_POPUP, (UINT)hSubMenu, "&stuff");

			SetMenu(hwnd,hMenu);
			
			hIcon = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
			if(hIcon)	//success
				SendMessage(hwnd,WM_SETICON,ICON_BIG,(LPARAM)hIcon);
			else	//fail
				MessageBox(hwnd,"Could not load large icon","Error",MB_OK | MB_ICONERROR);

			hIconSm = (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON,16,16,LR_LOADFROMFILE);			
			if(hIconSm)	//success
				SendMessage(hwnd,WM_SETICON,ICON_SMALL,(LPARAM)hIconSm);
			else
				MessageBox(hwnd,"Could not load small icon","Error", MB_OK | MB_ICONERROR);			
		}
		break;
#endif
	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case ID_HELP_ABOUT:
			{
				int ret = DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_ABOUT),hwnd,AboutDlgProc);
				if(ret == IDOK)
					MessageBox(hwnd,"Dialog exited with OK","Notice",MB_OK | MB_ICONINFORMATION);
				else if(ret == IDCANCEL)
					MessageBox(hwnd,"Dialog exited with Cancel","Notice", MB_OK | MB_ICONINFORMATION);
				else if(ret == -1)
					MessageBox(hwnd,"Dialog Failed!","Error",MB_OK | MB_ICONEXCLAMATION);					
			}
			break;
		case ID_FILE_EXIT:
			PostMessage(hwnd,WM_CLOSE,0,0);
			break;
		case ID_STUFF_GO:
			MessageBox(hwnd,"I go do something.","Do it",MB_OK);
			break;

		}
		break;
	case WM_LBUTTONDOWN:
		{
			char szFileName[MAX_PATH];
			HINSTANCE hInstance = GetModuleHandle(NULL);		//return a handle to the file used to
																//create a calling process
			GetModuleFileName(hInstance, szFileName, MAX_PATH);		//a pointer to a buffer that recives the path and file name
																	// of the specidied module
			MessageBox(hwnd, szFileName, "This program is:", MB_OK | MB_ICONINFORMATION);			 
			 break;
		}
	case WM_CLOSE:
		DestroyWindow(hwnd);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hwnd,msg,wParam,lParam);		//most likely does nothing
	}
	return 0;
}
开发者ID:pkhruasu,项目名称:winform32,代码行数:80,代码来源:main.c

示例6: switch


//.........这里部分代码省略.........
				if (set)
				{
					get_host()->override_status_text_create(p_status_override);

					if (p_status_override.is_valid())
					{
						p_status_override->override_text(desc);
					}
				}
				m_status_override = p_status_override;
			}
		}
	}
	break;
	case WM_CONTEXTMENU:
	{
		uie::window_ptr p_this_temp = this;
		if ((HWND)wp == wnd_header)
		{
			POINT pt = { (short)LOWORD(lp), (short)HIWORD(lp) };
			POINT temp;
			temp.x = pt.x;
			temp.y = pt.y;
			ScreenToClient(wnd_header, &temp);
			HDHITTESTINFO hittest;
			hittest.pt.x = temp.x;
			hittest.pt.y = temp.y;


			uSendMessage(wnd_header, HDM_HITTEST, 0, (LPARAM)&hittest);

			enum { IDM_ASC = 1, IDM_DES = 2, IDM_SEL_ASC, IDM_SEL_DES, IDM_AUTOSIZE, IDM_PREFS, IDM_EDIT_COLUMN, IDM_CUSTOM_BASE };

			HMENU menu = CreatePopupMenu();
			HMENU selection_menu = CreatePopupMenu();
			if (!(hittest.flags & HHT_NOWHERE))
			{
				uAppendMenu(menu, (MF_STRING), IDM_ASC, "&Sort ascending");
				uAppendMenu(menu, (MF_STRING), IDM_DES, "Sort &descending");
				uAppendMenu(selection_menu, (MF_STRING), IDM_SEL_ASC, "Sort a&scending");
				uAppendMenu(selection_menu, (MF_STRING), IDM_SEL_DES, "Sort d&escending");
				uAppendMenu(menu, MF_STRING | MF_POPUP, (UINT)selection_menu, "Se&lection");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");
				uAppendMenu(menu, (MF_STRING), IDM_EDIT_COLUMN, "&Edit this column");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");
				uAppendMenu(menu, (MF_STRING | (cfg_nohscroll ? MF_CHECKED : MF_UNCHECKED)), IDM_AUTOSIZE, "&Auto-sizing columns");
				uAppendMenu(menu, (MF_STRING), IDM_PREFS, "&Preferences");
				uAppendMenu(menu, (MF_SEPARATOR), 0, "");

				pfc::string8 playlist_name;
				static_api_ptr_t<playlist_manager> playlist_api;
				playlist_api->activeplaylist_get_name(playlist_name);

				pfc::string8_fast_aggressive filter, name;

				int s, e = columns.get_count();
				for (s = 0; s<e; s++)
				{
					bool add = false;
					switch (columns[s]->filter_type)
					{
					case FILTER_NONE:
					{
						add = true;
						break;
					}
开发者ID:9060,项目名称:columns_ui,代码行数:67,代码来源:playlist_view_msgproc.cpp

示例7: switch

LRESULT album_list_window::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
{

	switch (msg)
	{
	case WM_CREATE:
	{
		list_wnd.add_item(this);

		initialised = true;

		modeless_dialog_manager::g_add(wnd);

		create_tree();
		create_filter();

		if (cfg_populate) refresh_tree();

		static_api_ptr_t<library_manager_v3>()->register_callback(this);
	}
	break;
	/*case WM_GETMINMAXINFO:
	{
	LPMINMAXINFO mmi = LPMINMAXINFO(lp);
	mmi->ptMinTrackSize.y = cfg_height;
	return 0;
	}*/
	case WM_SIZE:
		on_size(LOWORD(lp), HIWORD(lp));
		break;
		/*	case DM_GETDEFID:
		return (DC_HASDEFID<<16|IDOK);
		case WM_GETDLGCODE:
		return DLGC_DEFPUSHBUTTON;*/
		//		break;
	case WM_TIMER:
		if (wp == EDIT_TIMER_ID)
		{
			refresh_tree();
			KillTimer(wnd, wp);
			m_timer = false;
		}
		break;
	case WM_COMMAND:
		switch (wp)
		{
		case IDC_FILTER | (EN_CHANGE << 16) :
			if (m_timer)
				KillTimer(wnd_edit, 500);
			m_timer = SetTimer(wnd, EDIT_TIMER_ID, 500, NULL) != 0;
			return TRUE;
		case IDOK:
			if (GetKeyState(VK_SHIFT) & KF_UP) do_playlist(p_selection, false);
			else if (GetKeyState(VK_CONTROL) & KF_UP) do_playlist(p_selection, true, true);
			else do_playlist(p_selection, true);
			return 0;
		}
		break;
	case WM_CONTEXTMENU:
	{
		enum { ID_SEND = 1, ID_ADD, ID_NEW, ID_AUTOSEND, ID_REMOVE, ID_REMOVEDEAD, ID_REFRESH, ID_FILT, ID_CONF, ID_VIEW_BASE };

		HMENU menu = CreatePopupMenu();

		POINT pt = { GET_X_LPARAM(lp), GET_Y_LPARAM(lp) };
		service_ptr_t<contextmenu_manager> p_menu_manager;

		unsigned IDM_MANAGER_BASE = 0;

		HWND list = wnd_tv;

		HTREEITEM treeitem = NULL;

		TVHITTESTINFO ti;
		memset(&ti, 0, sizeof(ti));

		if (pt.x != -1 && pt.y != -1)
		{
			ti.pt = pt;
			ScreenToClient(list, &ti.pt);
			uSendMessage(list, TVM_HITTEST, 0, (long)&ti);
			if (ti.hItem && (ti.flags & TVHT_ONITEM))
			{
				//FIX THIS AND AUTOSEND
				//TreeView_Select(list, ti.hItem, TVGN_DROPHILITE);
				//uSendMessage(list,TVM_SELECTITEM,TVGN_DROPHILITE,(long)ti.hItem);
				treeitem = ti.hItem;
			}
		}
		else
		{
			treeitem = TreeView_GetSelection(list);
			RECT rc;
			if (treeitem && TreeView_GetItemRect(wnd_tv, treeitem, &rc, TRUE))
			{
				MapWindowPoints(wnd_tv, HWND_DESKTOP, (LPPOINT)&rc, 2);

				pt.x = rc.left;
				pt.y = rc.top + (rc.bottom - rc.top) / 2;

//.........这里部分代码省略.........
开发者ID:ASopH,项目名称:columns_ui,代码行数:101,代码来源:main_window_proc.cpp

示例8: CPlaylistWindow_RenameMenu

void CPlaylistWindow_RenameMenu(const int iItem, const int iSubItem)
{
	HWND hWndList;
	POINT ptItem;
	RECT rSubItem;
	HMENU hmMenu;
	UINT uiMenuCommand;
	
	// We want to get the subitem's rect in the co-ordinate space of the dialog
	hWndList = CLV_GetHWND(globals.m_hPlaylistViewControl);
	CLV_GetItemSubRect(globals.m_hPlaylistViewControl, &rSubItem, iItem, iSubItem);
	ptItem.x = rSubItem.left;
	ptItem.y = rSubItem.bottom;
	ClientToScreen(hWndList, &ptItem);
	
	// Create menu
	hmMenu = CreatePopupMenu();
	
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsArtistAlbumNumberTitle, "Rename to <artist> - <album> - <tracknum> - <title>");
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsArtistNumberTitle, "Rename to <artist> - <tracknum> - <title>");
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsAlbumNumberTitle, "Rename to <album> - <tracknum> - <title>");
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsAlbumNumber, "Rename to <album> - <tracknum>");
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsNumberTitle, "Rename to <tracknum> - <title>");
	AppendMenu(hmMenu, MF_STRING, (DWORD)rwsTitle, "Rename to <title>");
	
	uiMenuCommand = TrackPopupMenuEx(hmMenu,
									 TPM_NONOTIFY
									 | TPM_RETURNCMD
									 | TPM_RIGHTBUTTON,
									 ptItem.x, ptItem.y,
									 IF_GetHWnd(windows.m_hifPlaylist),
									 NULL);
	DestroyMenu(hmMenu);
	
	if (uiMenuCommand)
	{
		int iSearchItemIDX;
		int iNumberOfErrors;
		
		iSearchItemIDX = CLV_GetNextSelectedItem(globals.m_hPlaylistViewControl, CPC_INVALIDITEM);
		iNumberOfErrors = 0;
		
		while (iSearchItemIDX != CPC_INVALIDITEM)
		{
			BOOL bSucceeded;
			bSucceeded = CPLI_RenameTrack((CP_HPLAYLISTITEM)CLV_GetItemData(globals.m_hPlaylistViewControl, iSearchItemIDX),
										  (CPe_FilenameFormat)uiMenuCommand);
			iSearchItemIDX = CLV_GetNextSelectedItem(globals.m_hPlaylistViewControl, iSearchItemIDX);
			
			if (!bSucceeded)
				iNumberOfErrors++;
		}
		
		if (iNumberOfErrors > 0)
		{
			MessageBox(IF_GetHWnd(windows.m_hifPlaylist),
					   "Some files could not be renamed.\n\nThis could be because they are either currently playing or are read-only.",
					   "Error",
					   MB_OK | MB_ICONASTERISK);
		}
	}
}
开发者ID:Runcy,项目名称:coolplayer,代码行数:62,代码来源:CPI_PlaylistWindow.c

示例9: OleUIAddVerbMenuW

/***********************************************************************
 *           OleUIAddVerbMenuW (OLEDLG.14)
 */
BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype,
    HMENU hMenu, UINT uPos, UINT idmin, UINT idmax, BOOL addConvert, UINT idConvert, HMENU *ret_submenu)
{
    IEnumOLEVERB *enumverbs = NULL;
    LPOLESTR usertype = NULL;
    OLEVERB firstverb, verb;
    WCHAR *objecttype;
    WCHAR resstrW[32]; /* should be enough */
    DWORD_PTR args[2];
    BOOL singleverb;
    HMENU submenu;
    WCHAR *str;

    TRACE("(%p, %s, %p, %d, %d, %d, %d, %d, %p)\n", object, debugstr_w(shorttype),
        hMenu, uPos, idmin, idmax, addConvert, idConvert, ret_submenu);

    if (ret_submenu)
        *ret_submenu = NULL;

    if (!hMenu || !ret_submenu)
        return FALSE;

    /* check if we can get verbs at all */
    if (object)
        IOleObject_EnumVerbs(object, &enumverbs);

    LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR));
    /* no object, or object without enumeration support */
    if (!object || !enumverbs) {
        InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING|MF_GRAYED, idmin, resstrW);
        return FALSE;
    }

    /* root entry string */
    if (!shorttype && (IOleObject_GetUserType(object, USERCLASSTYPE_SHORT, &usertype) == S_OK))
        objecttype = usertype;
    else
        objecttype = (WCHAR*)shorttype;

    /* iterate through verbs */

    /* find first suitable verb */
    get_next_insertable_verb(enumverbs, idmin, idmax, &firstverb);
    singleverb = get_next_insertable_verb(enumverbs, idmin, idmax, &verb) != S_OK;

    if (singleverb && !addConvert) {
        LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_SINGLEVERB_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR));

        args[0] = (DWORD_PTR)firstverb.lpszVerbName;
        args[1] = (DWORD_PTR)objecttype;

        FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_ARGUMENT_ARRAY,
            resstrW, 0, 0, (WCHAR*)&str, 0, (__ms_va_list*)args);

        RemoveMenu(hMenu, uPos, MF_BYPOSITION);
        InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING, idmin, str);
        CoTaskMemFree(firstverb.lpszVerbName);
        HeapFree(GetProcessHeap(), 0, str);
        IEnumOLEVERB_Release(enumverbs);
        CoTaskMemFree(usertype);
        return TRUE;
    }

    submenu = CreatePopupMenu();
    insert_verb_to_menu(submenu, idmin, &firstverb);
    CoTaskMemFree(firstverb.lpszVerbName);

    if (!singleverb) {
        insert_verb_to_menu(submenu, idmin, &verb);
        CoTaskMemFree(verb.lpszVerbName);
    }

    while (get_next_insertable_verb(enumverbs, idmin, idmax, &verb) == S_OK) {
        insert_verb_to_menu(submenu, idmin, &verb);
        CoTaskMemFree(verb.lpszVerbName);
    }

    /* convert verb is at the bottom of a popup, separated from verbs */
    if (addConvert) {
        LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_CONVERT, resstrW, sizeof(resstrW)/sizeof(WCHAR));
        InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_SEPARATOR, 0, NULL);
        InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_STRING, idConvert, resstrW);
    }

    if (submenu)
        *ret_submenu = submenu;

    /* now submenu is ready, add root entry to original menu, attach submenu */
    LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT_WITH_NAME, resstrW, sizeof(resstrW)/sizeof(WCHAR));

    args[0] = (DWORD_PTR)objecttype;
    FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_ARGUMENT_ARRAY,
        resstrW, 0, 0, (WCHAR*)&str, 0, (__ms_va_list*)args);

    InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_POPUP|MF_STRING, (UINT_PTR)submenu, str);
    HeapFree(GetProcessHeap(), 0, str);
    IEnumOLEVERB_Release(enumverbs);
//.........这里部分代码省略.........
开发者ID:Strongc,项目名称:reactos,代码行数:101,代码来源:oledlg_main.c

示例10: GetClientRect

LRESULT nsf_window::onCreate(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  RECT rcClient;
  GetClientRect(&rcClient);
  
  // get nsd/nsf
  unsigned long params[2];
  params[0] = (unsigned long)&nsf;
  params[1] = (unsigned long)&nsd;
  SendMessageRoot(MSG_GET_NSD, (WPARAM)0, (LPARAM)params);
  
  mainList   = new entryList(IDC_MAINTREE,       ENTRYLIST_NSF, nsf, nsd,   0, 0, 200, rcClient.bottom, hSelf);
  globalList = new entryList(IDC_GLOBALTREE, ENTRYLIST_DEFAULT, nsf, nsd, 484, 0, 118, rcClient.bottom, hSelf);
  lookupList = new entryList(IDC_LOOKUPTREE,     ENTRYLIST_NSD, nsf, nsd, 602, 0, 236, rcClient.bottom, hSelf);	  

  //484, 354
  hCodeMenu = CreatePopupMenu();
  AppendMenu(hCodeMenu, MF_STRING, ID_GOOL_VIEW, "Open in Code View");
   
  hModelMenuA = CreatePopupMenu();
  AppendMenu(hModelMenuA, MF_STRING, ID_MODEL_VIEW, "Open in Model/Zone View"); 
  AppendMenu(hModelMenuA, MF_SEPARATOR, ID_SEPARATOR, "");
  AppendMenu(hModelMenuA, MF_STRING, ID_MODEL_EXPORT_AS_COLLADA, "Export as COLLADA");    
      
  hModelMenuB = CreatePopupMenu();
  AppendMenu(hModelMenuB, MF_STRING, ID_MODEL_EXPORT_AS_MD3, "Export as .MD3");
  
  CreateWindowEx(0, WC_STATIC, "",
    WS_CHILD | WS_VISIBLE | SS_ETCHEDFRAME,
    210, 10, 250, 110,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "Type: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 25, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "Entry Count: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 55, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "Checksum: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 85, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 25, 100, 22, 
    hSelf, (HMENU)IDC_CHUNKTYPEEDIT, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 55, 100, 22, 
    hSelf, (HMENU)IDC_CHUNKENTRYCOUNTEDIT, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 85, 100, 22, 
    hSelf, (HMENU)IDC_CHUNKCHECKSUMEDIT, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "",
    WS_CHILD | WS_VISIBLE | SS_ETCHEDFRAME,
    210, 130, 250, 110,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "Type: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 145, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "Item Count: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 175, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(0, WC_STATIC, "n/a: ",
    WS_CHILD | WS_VISIBLE | SS_CENTER,
    220, 205, 110, 22,
    hSelf, NULL, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 145, 100, 22, 
    hSelf, (HMENU)IDC_ENTRYTYPEEDIT, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 175, 100, 22, 
    hSelf, (HMENU)IDC_ENTRYITEMCOUNTEDIT, hInstance, NULL);

  CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
    WS_CHILD | WS_VISIBLE, 
    320, 205, 100, 22, 
    hSelf, (HMENU)IDC_UNUSEDEDIT, hInstance, NULL);
    
  mainList->occupy();
  lookupList->occupy();
		  
//.........这里部分代码省略.........
开发者ID:Almamu,项目名称:crashutils,代码行数:101,代码来源:nsf_window.cpp

示例11: CPlaylistWindow_TrackStackMenu

void CPlaylistWindow_TrackStackMenu(iItem)
{
	HWND hWndList;
	POINT ptItem;
	RECT rSubItem;
	HMENU hmMenu;
	UINT uiMenuCommand;
	int iSearchItemIDX;
	CP_HPLAYLISTITEM hClickedItem;
	CPe_ItemStackState enClickedItemState;
	BOOL bMultipleSelection;
	
	// We want to get the subitem's rect in the co-ordinate space of the dialog
	hWndList = CLV_GetHWND(globals.m_hPlaylistViewControl);
	CLV_GetItemSubRect(globals.m_hPlaylistViewControl, &rSubItem, iItem, 0);
	
	// Are there multiple items selected?
	iSearchItemIDX = CLV_GetNextSelectedItem(globals.m_hPlaylistViewControl, CPC_INVALIDITEM);
	
	if (iSearchItemIDX != CPC_INVALIDITEM)
		iSearchItemIDX = CLV_GetNextSelectedItem(globals.m_hPlaylistViewControl, iSearchItemIDX);
		
	if (iSearchItemIDX != CPC_INVALIDITEM)
		bMultipleSelection = TRUE;
	else
		bMultipleSelection = FALSE;
		
	ptItem.x = rSubItem.left;
	ptItem.y = rSubItem.bottom;
	ClientToScreen(hWndList, &ptItem);
	
	// Create menu
	hmMenu = CreatePopupMenu();
	
	hClickedItem = (CP_HPLAYLISTITEM)CLV_GetItemData(globals.m_hPlaylistViewControl, iItem);
	
	enClickedItemState = CPL_Stack_GetItemState(globals.m_hPlaylist, hClickedItem);
	
	if (enClickedItemState != issUnstacked)
	{
		AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_PLAYFROMHERE, "Play from here");
		SetMenuDefaultItem(hmMenu, IDC_CMDTS_PLAYFROMHERE, FALSE);
		
		if (enClickedItemState != issStacked_Top)
		{
			AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_PLAYNEXT, "Play next");
			AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_UNSTACK, "Unstack");
		}
		
		// Not played yet?
		
		if (enClickedItemState == issStacked || enClickedItemState == issStacked_Top)
		{
			if (options.repeat_playlist == TRUE)
			{
				AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_STOPAFTER, "Repeat after this");
				AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_STOPAFTER_NOREP, "Stop after this (repeat->off)");
			}
			
			else
			{
				AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_STOPAFTER, "Stop after this");
			}
		}
		
		if (enClickedItemState != issStacked_Top)
			AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_QUEUE, "Queue at end");
	}
	
	else
	{
		AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_PLAYNOW, "Play now");
		SetMenuDefaultItem(hmMenu, IDC_CMDTS_PLAYNOW, FALSE);
		
		AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_PLAYNEXT, "Play next");
		AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_QUEUE, "Queue at end");
	}
	
	AppendMenu(hmMenu, MF_SEPARATOR, 0, NULL);
	
	AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_CLEARSTACK, "Clear stack");
	AppendMenu(hmMenu, MF_STRING, IDC_CMDTS_RESTACKALL, "Restack all");
	
	uiMenuCommand = TrackPopupMenuEx(hmMenu,
									 TPM_NONOTIFY
									 | TPM_RETURNCMD
									 | TPM_RIGHTBUTTON,
									 ptItem.x, ptItem.y,
									 IF_GetHWnd(windows.m_hifPlaylist),
									 NULL);
	DestroyMenu(hmMenu);
	
	if (uiMenuCommand == IDC_CMDTS_CLEARSTACK)
	{
		CPL_Stack_Clear(globals.m_hPlaylist);
	}
	
	else if (uiMenuCommand == IDC_CMDTS_RESTACKALL)
	{
		CPL_Stack_RestackAll(globals.m_hPlaylist);
//.........这里部分代码省略.........
开发者ID:Runcy,项目名称:coolplayer,代码行数:101,代码来源:CPI_PlaylistWindow.c

示例12: spline_win_message

int spline_win_message(SCREEN *sc,HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam)
{
	extern SPLINE_EDIT spline_edit;
	typedef enum CMDMENU{
		CMD_ADDKEY,CMD_DELKEY
	};
	static int clickx=0,clicky=0,debounce=0;
	static PARAM_CONTROL *pcdrag=0;
	static HMENU hmenu=0;
	static SPLINE_KEY_CONTROL *selected_key=0;
	PARAM_CONTROL *p;

	p=spline_edit.plist.list;
	if(FALSE)
	if(msg!=WM_PAINT&&msg!=WM_SETCURSOR&&msg!=WM_NCHITTEST&&msg!=WM_ENTERIDLE)
	{
		static DWORD tick;
		if((GetTickCount()-tick)>500)
			printf("--\n");
		printf("spl");
		print_msg(msg,lparam,wparam,hwnd);
		tick=GetTickCount();
	}
	switch(msg){
	case WM_CREATE:
		{
			hmenu=CreatePopupMenu();
			if(hmenu){
				InsertMenu(hmenu,0xFFFFFFFF,MF_BYPOSITION,CMD_ADDKEY,"add key");
				InsertMenu(hmenu,0xFFFFFFFF,MF_BYPOSITION,CMD_DELKEY,"delete key");
			}
		}
		break;
	case WM_CONTEXTMENU:
		if(hmenu){
			POINT point;
			int x,y;
			point.x=x=LOWORD(lparam);
			point.y=y=HIWORD(lparam);
			MapWindowPoints(NULL,hwnd,&point,1);
			clickx=x;
			clicky=y;
			point.x+=spline_edit.plist.si.hscroll;
			point.y+=spline_edit.plist.si.vscroll;
			if(hittest_param(p,point.x,point.y,0)){
				TrackPopupMenu(hmenu,TPM_LEFTALIGN,x,y,0,hwnd,NULL);
			}
		}
		break;
	case WM_KEYFIRST:
		switch(wparam){
		case VK_DELETE:
			PostMessage(hwnd,WM_COMMAND,CMD_DELKEY,0);
			break;
		}
		break;
	case WM_COMMAND:
		{
			PARAM_CONTROL *pc=0;
			if(p){
				find_param_type(&spline_edit.plist,CSPLINE,&pc);
				if(pc){
					
				}
			}
			switch(LOWORD(wparam)){
			case CMD_ADDKEY:
				{
					SPLINE_KEY *sk=0;
					POINT p;
					p.x=clickx;
					p.y=clicky;
					MapWindowPoints(NULL,hwnd,&p,1);
					p.x+=spline_edit.plist.si.hscroll;
					p.y+=spline_edit.plist.si.vscroll;

					add_splinekey(pc,&sk,p.x,p.y);
				}
				break;
			case CMD_DELKEY:
				del_sel_keys(pc);
				break;
			}
		}
		break;
	case WM_MOUSEWHEEL:
		{
			POINT point;
			PARAM_CONTROL *pc=0;
			point.x=LOWORD(lparam);
			point.y=HIWORD(lparam);
			MapWindowPoints(NULL,hwnd,&point,1);
			point.x+=spline_edit.plist.si.hscroll;
			point.y+=spline_edit.plist.si.vscroll;
			if(hittest_param(p,point.x,point.y,&pc)
				&& pc->control.type==CDROPLIST){
					signed short deltay=(HIWORD(wparam));
					send_mouse_wheel(pc,deltay);
					update_spline_selection(&spline_edit.plist);
			}
//.........这里部分代码省略.........
开发者ID:pinchyCZN,项目名称:demo_tool,代码行数:101,代码来源:spline_editor.c

示例13: Label

MenuPopUp::MenuPopUp(std::string text) : Label(text, 0, 0, 0, 0)
{
	hwnd = (HWND)CreatePopupMenu();
}
开发者ID:sypherce,项目名称:ds2key,代码行数:4,代码来源:menuPopUp.cpp

示例14: EV_DlgMain

BOOL CALLBACK EV_DlgMain(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
    case WM_INITDIALOG:
    {
        EV_shared=hwndDlg;
        EV_list_hwnd=GetDlgItem(hwndDlg, IDC_LIST);
    }
    return TRUE;

    case WM_CLOSE:
    {
        EndDialog(hwndDlg, 0);
    }
    return TRUE;

    case WM_BROWSE:
    {
        SendMessageA(EV_list_hwnd, LB_RESETCONTENT, 0, 0);
        strcpy(EV_szFileName, (const char*)wParam);
        strcpy(EV_program_dir, EV_szFileName);
        int i=strlen(EV_program_dir);
        while(EV_program_dir[i]!='\\')
            i--;
        EV_program_dir[i]=0;
        CreateThread(0, 0, EV_DebugThread, 0, 0, 0);
    }
    return TRUE;

    case WM_DROPFILES:
    {
        SendMessageA(EV_list_hwnd, LB_RESETCONTENT, 0, 0);
        DragQueryFileA((HDROP)wParam, 0, EV_szFileName, MAX_PATH);
        strcpy(EV_program_dir, EV_szFileName);
        int i=strlen(EV_program_dir);
        while(EV_program_dir[i]!='\\')
            i--;
        EV_program_dir[i]=0;
        CreateThread(0, 0, EV_DebugThread, 0, 0, 0);
    }
    return TRUE;

    case WM_CONTEXTMENU:
    {
        if(GetDlgCtrlID((HWND)wParam)==IDC_LIST)
        {
            LeftClick();
            LeftClick();
        }
    }
    return TRUE;

    case WM_HELP:
    {
        char id[10]="";
        sprintf(id, "%d", IDS_HELPEVLOG);
        SetEnvironmentVariableA("HELPID", id);
        SetEnvironmentVariableA("HELPTITLE", "EVLog Help");
        DialogBox(hInst, MAKEINTRESOURCE(DLG_HELP), hwndDlg, DlgHelp);
    }
    return TRUE;

    case WM_COMMAND:
    {
        switch(LOWORD(wParam))
        {
        case IDC_LIST:
        {
            switch(HIWORD(wParam))
            {
            case LBN_DBLCLK:
            {
                int cursel=SendMessageA(EV_list_hwnd, LB_GETCURSEL, 0, 0);
                int count=SendMessageA(EV_list_hwnd, LB_GETCOUNT, 0, 0);
                if(!count)
                    return TRUE;
                char line_text[1024]="";
                char var_name[512]="";
                char var_value[512]="";
                SendMessageA(EV_list_hwnd, LB_GETTEXT, cursel, (LPARAM)line_text);
                int len=strlen(line_text);
                for(int i=0,j=0,k=0,l=0; i<len; i++)
                {
                    if(line_text[i]=='=')
                    {
                        i++;
                        j=1;
                    }
                    if(!j)
                        k+=sprintf(var_name+k, "%c", line_text[i]);
                    else
                        l+=sprintf(var_value+l, "%c", line_text[i]);
                }
                HMENU myMenu=0;
                myMenu=CreatePopupMenu();
                AppendMenu(myMenu, MF_STRING, 1, "Copy Variable &Name");
                if(strcmp(var_value, "(0)"))
                    AppendMenu(myMenu, MF_STRING, 2, "Copy Variable &Value");
                AppendMenu(myMenu, MF_STRING, 3, "Copy &Line");
//.........这里部分代码省略.........
开发者ID:cdaze,项目名称:akt,代码行数:101,代码来源:EVLog_maindlg.cpp

示例15: switch


//.........这里部分代码省略.........
		{
			m_panel_dragging_valid = false;
			if (GetCapture() == wnd)
				ReleaseCapture();
			//SetCursor(LoadCursor(0, IDC_ARROW));
		}
		break;
#if 0
	case WM_PAINT:
	{
		PAINTSTRUCT ps;
		BeginPaint(wnd, &ps);
		COLORREF cr = GetSysColor(COLOR_3DFACE);
		gdi_object_t<HBRUSH>::ptr_t br_line = CreateSolidBrush(/*RGB(226, 226, 226)*/cr);

		t_size n, count = m_panels.get_count();
		for (n = 0; n + 1<count; n++)
		{
			pfc::refcounted_object_ptr_t<panel> p_item = m_panels.get_item(n);

			if (p_item->m_wnd_child)
			{
				RECT rc_area;
				GetRelativeRect(p_item->m_wnd_child, m_wnd, &rc_area);
				if (get_orientation() == vertical)
				{
					rc_area.top = rc_area.bottom;
					rc_area.bottom += 2;
					//FillRect(ps.hdc, &rc_area, GetSysColorBrush(COLOR_WINDOW));
					//rc_area.top++;
				}
				else
				{
					rc_area.left = rc_area.right;
					rc_area.right += 2;
					//FillRect(ps.hdc, &rc_area, GetSysColorBrush(COLOR_WINDOW));
					//rc_area.right--;
				}
				FillRect(ps.hdc, &rc_area, br_line);
			}
		}

		EndPaint(wnd, &ps);

	}
	;
#endif
#if 0
	case WM_CONTEXTMENU:
		if ((HWND)wp == wnd)
		{
			window_transparent_fill m_trans_fill;

			if (m_layout_editing_active)
			{
				RECT rc;
				GetRelativeRect(wnd, HWND_DESKTOP, &rc);
				ShowWindow(m_trans_fill.create(get_wnd(), 0, ui_helpers::window_position_t(rc)), SW_SHOWNORMAL);
				POINT pt = { GET_X_LPARAM(lp), GET_Y_LPARAM(lp) };

				HMENU menu = CreatePopupMenu();
				HMENU menu_add = CreatePopupMenu();
				uie::window_info_list_simple panels;
				g_get_panel_list(panels);
				enum { ID_CLOSE = 1, ID_ADD_BASE = 2 };
				g_append_menu_panels(menu_add, panels, ID_ADD_BASE);
				pfc::string8 temp;
				get_name(temp);
				uAppendMenu(menu, MF_STRING | MF_GRAYED, (UINT_PTR)0, temp);
				uAppendMenu(menu, MF_MENUBREAK, (UINT_PTR)0, NULL);
				AppendMenu(menu, MF_STRING | MF_POPUP, (UINT_PTR)menu_add, L"Add panel");

				int cmd = TrackPopupMenu(menu, TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, pt.x, pt.y, 0, m_trans_fill.get_wnd(), 0);
				DestroyMenu(menu);
				m_trans_fill.destroy();

				if (cmd)
				{
					if (cmd >= ID_ADD_BASE && cmd < panels.get_count() + ID_ADD_BASE)
					{
						pfc::refcounted_object_ptr_t<panel> ptr = new panel;
						ptr->m_guid = panels[cmd - ID_ADD_BASE].guid;
						m_panels.add_item(ptr);
						refresh_children();
						get_host()->on_size_limit_change(get_wnd(), uie::size_limit_all);
						uie::splitter_window_v2_ptr sw2;
						if (ptr->m_child.is_valid() && ptr->m_child->service_query_t(sw2))
						{
							sw2->enter_layout_editing_mode();
						}
					}
				}
			}
			return 0;
		}
		break;
#endif
	}
	return DefWindowProc(wnd, msg, wp, lp);
}
开发者ID:i7voodoo,项目名称:columns_ui,代码行数:101,代码来源:splitter_window_wndproc.cpp


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