• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MAKEINTRESOURCEW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OnLogOff

static
INT
OnLogOff(
    IN HWND hwndDlg,
    IN PGINA_CONTEXT pgContext)
{
    return pgContext->pWlxFuncs->WlxDialogBoxParam(
               pgContext->hWlx,
               pgContext->hDllInstance,
               MAKEINTRESOURCEW(IDD_LOGOFF_DLG),
               hwndDlg,
               LogOffDialogProc,
               (LPARAM)pgContext);
}
开发者ID:Strongc,项目名称:reactos,代码行数:14,代码来源:gui.c


示例2: OnShutDown

static
INT
OnShutDown(
    IN HWND hwndDlg,
    IN PGINA_CONTEXT pgContext)
{
    return pgContext->pWlxFuncs->WlxDialogBoxParam(
               pgContext->hWlx,
               pgContext->hDllInstance,
               MAKEINTRESOURCEW(IDD_SHUTDOWN_DLG),
               hwndDlg,
               ShutDownDialogProc,
               (LPARAM)pgContext);
}
开发者ID:Strongc,项目名称:reactos,代码行数:14,代码来源:gui.c


示例3: GUIDisplayLockedNotice

static VOID
GUIDisplayLockedNotice(
    IN OUT PGINA_CONTEXT pgContext)
{
    TRACE("GUIdisplayLockedNotice()\n");

    pgContext->pWlxFuncs->WlxDialogBoxParam(
        pgContext->hWlx,
        pgContext->hDllInstance,
        MAKEINTRESOURCEW(IDD_LOCKED_DLG),
        GetDesktopWindow(),
        LockedWindowProc,
        (LPARAM)pgContext);
}
开发者ID:Strongc,项目名称:reactos,代码行数:14,代码来源:gui.c


示例4: GUIDisplaySASNotice

static VOID
GUIDisplaySASNotice(
    IN OUT PGINA_CONTEXT pgContext)
{
    TRACE("GUIDisplaySASNotice()\n");

    /* Display the notice window */
    pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
                                            pgContext->hDllInstance,
                                            MAKEINTRESOURCEW(IDD_NOTICE_DLG),
                                            GetDesktopWindow(),
                                            EmptyWindowProc,
                                            (LPARAM)pgContext);
}
开发者ID:Strongc,项目名称:reactos,代码行数:14,代码来源:gui.c


示例5: UT_ASSERT

void XAP_Win32Dialog_WindowMore::runModal(XAP_Frame * pFrame)
{
	UT_ASSERT(pFrame);
	UT_ASSERT(m_id == XAP_DIALOG_ID_WINDOWMORE);
	
	// NOTE: this work could be done in XP code
	m_ndxSelFrame = m_pApp->findFrame(pFrame);
	UT_ASSERT(m_ndxSelFrame >= 0);

	// raise the dialog
	setDialog(this);
	createModal(pFrame, MAKEINTRESOURCEW(XAP_RID_DIALOG_WINDOWMORE));

}
开发者ID:tchx84,项目名称:debian-abiword-packages,代码行数:14,代码来源:xap_Win32Dlg_WindowMore.cpp


示例6: create_native_window

/*****************************************************
 * Hack ahead !!!
 *
 * Problems here have to do with focus handling, i.e.
 * sharing and passing keyboard focus back and forth from
 * the gecko window to the rest of the app. The gecko
 * wants us to turn focus on and off when we receive the
 * WM_ACTIVATE message for our window; Gtk+ does not give
 * us an opportunity to act on this message (TODO: patch
 * gtk+ to do so and run tests).
 *
 * Also tried to turn on and off focus near when activate
 * messages come (i.e. focus in/out of the toplevel window)
 * with no luck (works to get started, but the gecko
 * will never relinquish focus afterwords).
 *
 * The current hack/workaround:
 *   We are using a native toplevel window, that we reposition
 * to follow the widget hierarchy on toplevel configure events,
 * this way we handle the WM_ACTIVATE messages and focus handleing
 * works, on the other hand accelerators keys tied into the higher
 * level window wont trigger when the gecko has focus (is that
 * already the case ?) and the apps toplevel will be painted as
 * an inactive window.
 */
static HWND
create_native_window(GtkWidget *widget)
{
    static ATOM klass = 0;
    HWND window_handle, parent_handle;
    DWORD dwStyle, dwExStyle;

    if (!klass) {
         static WNDCLASSEXW wcl;

         wcl.cbSize = sizeof(WNDCLASSEX);
         wcl.style = 0;

        /* DON'T set CS_<H,V>REDRAW. It causes total redraw
         * on WM_SIZE and WM_MOVE. Flicker, Performance!
         */
         wcl.lpfnWndProc = (WNDPROC)window_procedure;
         wcl.cbClsExtra = 0;
         wcl.cbWndExtra = 0;
         wcl.hInstance = GetModuleHandle(NULL);
         wcl.hIcon = 0;
         wcl.hIconSm = 0;
         wcl.lpszMenuName = NULL;
         wcl.hIcon = NULL;
         wcl.hIconSm = NULL;
         wcl.hbrBackground = NULL;
         wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
         wcl.lpszClassName = L"MozWindow";

         klass = RegisterClassExW(&wcl);
    }

    dwExStyle = WS_EX_TOOLWINDOW; // for popup windows
    dwStyle = WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; // popup window

    parent_handle = (HWND)GDK_WINDOW_HWND(gtk_widget_get_parent_window(widget));
    window_handle = CreateWindowExW(dwExStyle,
                                    MAKEINTRESOURCEW(klass),
                                    L"",
                                    dwStyle,
                                    0, 0, 1, 1,
                                    parent_handle,
                                    NULL,
                                    GetModuleHandle(NULL),
                                    NULL);

    SetProp(window_handle, "moz-view-widget", (HANDLE)widget);

    return window_handle;
}
开发者ID:gistinc,项目名称:Gecko,代码行数:75,代码来源:moz-web-view.cpp


示例7: ISvItemCm_fnQueryContextMenu

/**************************************************************************
* ISvItemCm_fnQueryContextMenu()
*/
static HRESULT WINAPI ISvItemCm_fnQueryContextMenu(
	IContextMenu2 *iface,
	HMENU hmenu,
	UINT indexMenu,
	UINT idCmdFirst,
	UINT idCmdLast,
	UINT uFlags)
{
    ItemCmImpl *This = impl_from_IContextMenu2(iface);
    INT uIDMax;

    TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);

    This->verb_offset=idCmdFirst;

    if(!(CMF_DEFAULTONLY & uFlags) && This->cidl>0)
    {
        HMENU hmenures = LoadMenuW(shell32_hInstance, MAKEINTRESOURCEW(MENU_SHV_FILE));

        if(uFlags & CMF_EXPLORE)
            RemoveMenu(hmenures, FCIDM_SHVIEW_OPEN, MF_BYCOMMAND);

        uIDMax = Shell_MergeMenus(hmenu, GetSubMenu(hmenures, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS);

        DestroyMenu(hmenures);

        if(This->bAllValues)
        {
            MENUITEMINFOW mi;
            WCHAR str[255];
            mi.cbSize = sizeof(mi);
            mi.fMask = MIIM_ID | MIIM_STRING | MIIM_FTYPE;
            mi.dwTypeData = str;
            mi.cch = 255;
            GetMenuItemInfoW(hmenu, FCIDM_SHVIEW_EXPLORE, MF_BYCOMMAND, &mi);
            RemoveMenu(hmenu, FCIDM_SHVIEW_EXPLORE, MF_BYCOMMAND);
            _InsertMenuItemW(hmenu, (uFlags & CMF_EXPLORE) ? 1 : 2, MF_BYPOSITION, FCIDM_SHVIEW_EXPLORE, MFT_STRING, str, MFS_ENABLED);
        }

        SetMenuDefaultItem(hmenu, 0, MF_BYPOSITION);

        if(uFlags & ~CMF_CANRENAME)
            RemoveMenu(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND);
        else
            EnableMenuItem(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND | ISvItemCm_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED);

        return MAKE_HRESULT(SEVERITY_SUCCESS, 0, uIDMax-idCmdFirst);
    }
    return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0);
}
开发者ID:Sunmonds,项目名称:wine,代码行数:53,代码来源:shv_item_cmenu.c


示例8: DIALOG_FileSaveAs

BOOL DIALOG_FileSaveAs(VOID)
{
    OPENFILENAMEW saveas;
    WCHAR szPath[MAX_PATH];
    WCHAR szDir[MAX_PATH];
    static const WCHAR szDefaultExt[] = { 't','x','t',0 };
    static const WCHAR txt_files[] = { '*','.','t','x','t',0 };

    ZeroMemory(&saveas, sizeof(saveas));

    GetCurrentDirectoryW(ARRAY_SIZE(szDir), szDir);
    lstrcpyW(szPath, txt_files);

    saveas.lStructSize       = sizeof(OPENFILENAMEW);
    saveas.hwndOwner         = Globals.hMainWnd;
    saveas.hInstance         = Globals.hInstance;
    saveas.lpstrFilter       = Globals.szFilter;
    saveas.lpstrFile         = szPath;
    saveas.nMaxFile          = ARRAY_SIZE(szPath);
    saveas.lpstrInitialDir   = szDir;
    saveas.Flags          = OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER |
                            OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT |
                            OFN_HIDEREADONLY | OFN_ENABLESIZING;
    saveas.lpfnHook          = OfnHookProc;
    saveas.lpTemplateName    = MAKEINTRESOURCEW(IDD_OFN_TEMPLATE);
    saveas.lpstrDefExt       = szDefaultExt;

    /* Preset encoding to what file was opened/saved last with. */
    Globals.encOfnCombo = Globals.encFile;
    Globals.bOfnIsOpenDialog = FALSE;

retry:
    if (!GetSaveFileNameW(&saveas))
        return FALSE;

    switch (DoSaveFile(szPath, Globals.encOfnCombo))
    {
        case SAVED_OK:
            SetFileNameAndEncoding(szPath, Globals.encOfnCombo);
            UpdateWindowCaption();
            return TRUE;

        case SHOW_SAVEAS_DIALOG:
            goto retry;

        default:
            return FALSE;
    }
}
开发者ID:bilboed,项目名称:wine,代码行数:49,代码来源:dialog.c


示例9: AddTool

BOOL CToolTipCtrl::AddTool(HWND hWnd,UINT nIDText,LPCRECT lpRectTool,UINT nIDTool,LPARAM lParam)
{
	if (IsUnicodeSystem())
	{
		TOOLINFOW ti;
		ti.cbSize=TTTOOLINFOW_V2_SIZE;
		ti.uFlags=TTF_SUBCLASS;
		ti.hwnd=hWnd;
		ti.uId=nIDTool;
		ti.hinst=GetLanguageSpecificResourceHandle();
		ti.lpszText=MAKEINTRESOURCEW(nIDText);
		ti.lParam=lParam;	
		if (lpRectTool!=NULL)
			ti.rect=*lpRectTool;
		else if (hWnd!=NULL)
			::GetClientRect(hWnd,&ti.rect);
		else
		{
			ti.rect.left=0;
			ti.rect.right=0;
			ti.rect.top=0;
			ti.rect.bottom=0;
		}
		return (BOOL)::SendMessageW(m_hWnd,TTM_ADDTOOLW,0,(LPARAM)&ti);
	}
	else
	{
		TOOLINFO ti;
		ti.cbSize=TTTOOLINFOA_V2_SIZE;
		ti.uFlags=TTF_SUBCLASS;
		ti.hwnd=hWnd;
		ti.uId=nIDTool;
		ti.hinst=GetLanguageSpecificResourceHandle();
		ti.lpszText=MAKEINTRESOURCE(nIDText);
		ti.lParam=lParam;	
		if (lpRectTool!=NULL)
			ti.rect=*lpRectTool;
		else if (hWnd!=NULL)
			::GetClientRect(hWnd,&ti.rect);
		else
		{
			ti.rect.left=0;
			ti.rect.right=0;
			ti.rect.top=0;
			ti.rect.bottom=0;
		}
		return (BOOL)::SendMessage(m_hWnd,TTM_ADDTOOL,0,(LPARAM)&ti);
	}
}
开发者ID:joshball,项目名称:locate32-cogit.net,代码行数:49,代码来源:CommonControls.cpp


示例10: DownloadDlgProc

static
INT_PTR CALLBACK
DownloadDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    HANDLE Thread;
    DWORD ThreadId;
    HWND Item;

    switch (Msg)
    {
        case WM_INITDIALOG:

            hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN));
            if (hIcon)
            {
                SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
                SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon);
            }

            SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
            Item = GetDlgItem(Dlg, IDC_DOWNLOAD_PROGRESS);
            if (Item)
            {
                SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
                SendMessageW(Item, PBM_SETPOS, 0, 0);
            }

            Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
            if (!Thread) return FALSE;
            CloseHandle(Thread);
            return TRUE;

        case WM_COMMAND:
            if (wParam == IDCANCEL)
            {
                SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1);
                PostMessageW(Dlg, WM_CLOSE, 0, 0);
            }
            return FALSE;

        case WM_CLOSE:
            if (hIcon) DestroyIcon(hIcon);
            EndDialog(Dlg, 0);
            return TRUE;

        default:
            return FALSE;
    }
}
开发者ID:Strongc,项目名称:reactos,代码行数:49,代码来源:loaddlg.cpp


示例11: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	FPS = 1/60;
	interval = 1000*FPS;
	HWND hwnd;
	MSG msg 		= {0};
	WNDCLASSEX wc	= {0};
	wc.cbSize 		= sizeof(WNDCLASSEX);
	wc.lpfnWndProc 	= WndProc;
	wc.hInstance 	= GetModuleHandle(NULL);
	wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
	wc.lpszClassName = "Hello,world";
	wc.style = CS_OWNDC;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hCursor		= LoadCursor(NULL,IDC_ARROW);
	wc.hIcon		= LoadIconW(NULL,MAKEINTRESOURCEW(IDI_APPLICATION));
	wc.hIconSm		= LoadIconW(NULL,MAKEINTRESOURCEW(IDI_APPLICATION));
	if(!RegisterClassEx(&wc))
		return 1;
	hwnd = CreateWindowW(L"Hello,World",L"Hello,World",WS_OVERLAPPEDWINDOW|WS_VISIBLE,0,0,640,480,0,0,hInstance,0);
	ShowWindow(hwnd, nCmdShow);              //display the window on the screen
	UpdateWindow(hwnd);
	while(GetMessage(&msg,NULL,0,0) > 0)
	{
		DispatchMessage(&msg);
		time_t elapse = time(NULL) - appTime;
		if(elapse >= interval)
		{
			appTime += elapse;
		}
	}
		
	
	return 0;
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:36,代码来源:main.cpp


示例12: slot1Dialog

void slot1Dialog(HWND hwnd)
{
	strcpy(tmp_fat_path, slot1_GetFatDir().c_str());
	strcpy(tmp_fs_path, path.getpath(path.SLOT1D).c_str());
	temp_type_slot1 = slot1_GetCurrentType();
	last_type_slot1 = temp_type_slot1;
	_OKbutton_slot1 = false;
	needReset_slot1 = true;
	u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_SLOT1CONFIG), hwnd, (DLGPROC)Slot1Box_Proc);
	if (res)
	{
		switch (temp_type_slot1)
		{
			case NDS_SLOT1_NONE:
				if (temp_type_slot1 != slot1_GetCurrentType())
					needReset_slot1 = true;
				else
					needReset_slot1 = false;
				break;
			case NDS_SLOT1_RETAIL_AUTO:
			case NDS_SLOT1_RETAIL_MCROM:
				break;
			case NDS_SLOT1_R4:
				if (strlen(tmp_fat_path))
				{
					slot1_SetFatDir(tmp_fat_path);
					WritePrivateProfileString("Slot1","FAT_path",tmp_fat_path,IniName);
				}
				break;
			case NDS_SLOT1_RETAIL_NAND:
				break;
			case NDS_SLOT1_RETAIL_DEBUG:
				if (strlen(tmp_fs_path))
				{
					path.setpath(path.SLOT1D, tmp_fs_path);
					WritePrivateProfileString(SECTION, SLOT1DKEY, path.pathToSlot1D, IniName);
				}
				break;
			default:
				return;
		}
		WritePrivateProfileInt("Slot1","type",temp_type_slot1,IniName);

		slot1_Change((NDS_SLOT1_TYPE)temp_type_slot1);
		
		return;
	}
}
开发者ID:rafaelmessias,项目名称:desmume,代码行数:48,代码来源:slot1_config.cpp


示例13: RecycleBinMenu_QueryContextMenu

static HRESULT WINAPI RecycleBinMenu_QueryContextMenu(IContextMenu2 *iface,
                                                      HMENU hmenu,
                                                      UINT indexMenu,
                                                      UINT idCmdFirst,
                                                      UINT idCmdLast,
                                                      UINT uFlags)
{
    HMENU menures = LoadMenuW(shell32_hInstance,MAKEINTRESOURCEW(MENU_RECYCLEBIN));
    if(uFlags & CMF_DEFAULTONLY)
        return E_NOTIMPL;
    else{
        UINT idMax = Shell_MergeMenus(hmenu,GetSubMenu(menures,0),indexMenu,idCmdFirst,idCmdLast,MM_SUBMENUSHAVEIDS);
        TRACE("Added %d id(s)\n",idMax-idCmdFirst);
        return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idMax-idCmdFirst+1);
    }
}
开发者ID:YokoZar,项目名称:wine,代码行数:16,代码来源:recyclebin.c


示例14: UT_return_if_fail

void AP_Win32Dialog_FormatFrame::runModeless(XAP_Frame * pFrame)
{
	UT_return_if_fail (pFrame);		

	UT_return_if_fail (m_id == AP_DIALOG_ID_FORMAT_FRAME);	

	 createModeless(pFrame, MAKEINTRESOURCEW(AP_RID_DIALOG_FORMATFRAME));

	// Save dialog the ID number and pointer to the widget
	UT_sint32 sid =(UT_sint32)  getDialogId();
	m_pApp->rememberModelessId( sid, (XAP_Dialog_Modeless *) m_pDialog);

	ShowWindow(m_hDlg, SW_SHOW);
	BringWindowToTop(m_hDlg);	
		
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:16,代码来源:ap_Win32Dialog_FormatFrame.cpp


示例15: FsExecuteFileW

int __stdcall FsExecuteFileW(HWND MainWin, WCHAR* RemoteName, WCHAR* Verb) {
    INT_PTR dlgResult = 0;
    if(wcscmp(Verb, L"open") == 0 && wcscmp(RemoteName, L"\\[²Ù×÷]ÐÂÔöÍøÅÌ") == 0) {
        if(!available_disk_entries_length) {
            RequestProcW(PluginNumber, RT_MsgOK, L"ÅäÖôíÎó", L"ÍøÅ̽ű¾´íÎó, ûÓÐÉèÖÃÈκÎÓÐЧµÄÍøÅÌÅäÖÃÎļþ. ", NULL, 0);
            return FS_EXEC_ERROR;
        }
        dlgResult = DialogBoxW((HINSTANCE)hInst, MAKEINTRESOURCEW(IDD_NEW), GetActiveWindow(), NewdiskProc);
        if(dlgResult == IDOK) {
            wcslcpy(RemoteName, L"\\", PATH_MAX);
            return FS_EXEC_SYMLINK;
        }
        return FS_EXEC_OK;
    }
    return FS_EXEC_ERROR;
}
开发者ID:kerneltravel,项目名称:netdisk4tc,代码行数:16,代码来源:ndpluginw.c


示例16: PropSheetProc

static int CALLBACK
PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{
    // NOTE: This callback is needed to set large icon correctly.
    HICON hIcon;
    switch (uMsg)
    {
        case PSCB_INITIALIZED:
        {
            hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_USRMGR_ICON));
            SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
            break;
        }
    }
    return 0;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:16,代码来源:usrmgr.c


示例17: dlg_configure_lpt

static BOOL dlg_configure_lpt(HANDLE hXcv, HWND hWnd)
{
    lptconfig_t data;
    BOOL  res;


    data.hXcv = hXcv;

    res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(LPTCONFIG_DIALOG), hWnd,
                               dlgproc_lptconfig, (LPARAM) &data);

    TRACE("got %u with %u\n", res, GetLastError());

    if (!res) SetLastError(ERROR_CANCELLED);
    return res;
}
开发者ID:Barrell,项目名称:wine,代码行数:16,代码来源:localui.c


示例18: show_wait_window

static HWND show_wait_window(void)
{
    const char *config_dir = wine_get_config_dir();
    WCHAR *name;
    HWND hwnd;
    DWORD len;

    len = MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, NULL, 0 );
    name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
    MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, name, len );
    hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0,
                               wait_dlgproc, (LPARAM)name );
    ShowWindow( hwnd, SW_SHOWNORMAL );
    HeapFree( GetProcessHeap(), 0, name );
    return hwnd;
}
开发者ID:klickverbot,项目名称:wine,代码行数:16,代码来源:wineboot.c


示例19: DisplayPopupMenu

static void DisplayPopupMenu(HHInfo *info)
{
    HMENU menu, submenu;
    TBBUTTONINFOW button;
    MENUITEMINFOW item;
    POINT coords;
    RECT rect;
    DWORD index;

    menu = LoadMenuW(hhctrl_hinstance, MAKEINTRESOURCEW(MENU_POPUP));

    if (!menu)
        return;

    submenu = GetSubMenu(menu, 0);

    /* Update the Show/Hide menu item */
    item.cbSize = sizeof(MENUITEMINFOW);
    item.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_STRING;
    item.fType = MFT_STRING;
    item.fState = MF_ENABLED;

    if (info->WinType.fNotExpanded)
        item.dwTypeData = HH_LoadString(IDS_SHOWTABS);
    else
        item.dwTypeData = HH_LoadString(IDS_HIDETABS);

    SetMenuItemInfoW(submenu, IDTB_EXPAND, FALSE, &item);
    heap_free(item.dwTypeData);

    /* Find the index toolbar button */
    button.cbSize = sizeof(TBBUTTONINFOW);
    button.dwMask = TBIF_COMMAND;
    index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button);

    if (index == -1)
       return;

    /* Get position */
    SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect);

    coords.x = rect.left;
    coords.y = rect.bottom;

    ClientToScreen(info->WinType.hwndToolBar, &coords);
    TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL);
}
开发者ID:YokoZar,项目名称:wine,代码行数:47,代码来源:help.c


示例20: ApplicationPageShowContextMenu2

static void ApplicationPageShowContextMenu2(void)
{
    HMENU   hMenu;
    HMENU   hSubMenu;
    UINT    count;
    POINT   pt;

    GetCursorPos(&pt);

    hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATION_PAGE_CONTEXT2));
    hSubMenu = GetSubMenu(hMenu, 0);

    count = SendMessageW(hApplicationPageListCtrl, LVM_GETSELECTEDCOUNT, 0, 0);
    if (count == 1)
    {
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_ENABLED);
    }
    else if (count > 1)
    {
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_ENABLED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
    }
    else
    {
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
        EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
    }

    SetMenuDefaultItem(hSubMenu, ID_APPLICATION_PAGE_SWITCHTO, MF_BYCOMMAND);

    TrackPopupMenu(hSubMenu, TPM_LEFTALIGN|TPM_TOPALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, hMainWnd, NULL);

    DestroyMenu(hMenu);
}
开发者ID:klickverbot,项目名称:wine,代码行数:47,代码来源:applpage.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MAKELANGID函数代码示例发布时间:2022-05-30
下一篇:
C++ MAKEINTRESOURCEA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap