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

C++ GetAncestor函数代码示例

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

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



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

示例1: GetAncestor

HWND uie::window::g_on_tab(HWND wnd_focus)
{
	HWND rv = 0;
	
	HWND wnd_temp = GetAncestor(wnd_focus, GA_ROOT);/*_GetParent(wnd_focus);
	
	while (wnd_temp && GetWindowLong(wnd_temp, GWL_EXSTYLE) & WS_EX_CONTROLPARENT)
	{
		if (GetWindowLong(wnd_temp, GWL_STYLE) & WS_POPUP) break;
		else wnd_temp = _GetParent(wnd_temp);
	}*/
	
	if (wnd_temp)
	{
		HWND wnd_next = GetNextDlgTabItem(wnd_temp, wnd_focus, (GetKeyState(VK_SHIFT) & KF_UP) ? TRUE :  FALSE);
		if (wnd_next && wnd_next != wnd_focus) 
		{
			unsigned flags = uSendMessage(wnd_next, WM_GETDLGCODE, 0, 0);
			if (flags & DLGC_HASSETSEL) uSendMessage(wnd_next, EM_SETSEL, 0, -1);
			SetFocus(wnd_next);
			
			rv = wnd_next;
		}
	}
	return rv;
};
开发者ID:19379,项目名称:foo-jscript-panel,代码行数:26,代码来源:ui_extension.cpp


示例2: onWM_COMMAND

static BOOL onWM_COMMAND(uiControl *c, HWND hwnd, WORD code, LRESULT *lResult)
{
	uiColorButton *b = uiColorButton(c);
	HWND parent;
	struct colorDialogRGBA rgba;

	if (code != BN_CLICKED)
		return FALSE;

	parent = GetAncestor(b->hwnd, GA_ROOT);		// TODO didn't we have a function for this
	rgba.r = b->r;
	rgba.g = b->g;
	rgba.b = b->b;
	rgba.a = b->a;
	if (showColorDialog(parent, &rgba)) {
		b->r = rgba.r;
		b->g = rgba.g;
		b->b = rgba.b;
		b->a = rgba.a;
		invalidateRect(b->hwnd, NULL, TRUE);
		(*(b->onChanged))(b, b->onChangedData);
	}

	*lResult = 0;
	return TRUE;
}
开发者ID:123vipulj,项目名称:libui,代码行数:26,代码来源:colorbutton.cpp


示例3: inplace_frame_GetWindow

static HRESULT STDMETHODCALLTYPE
inplace_frame_GetWindow(IOleInPlaceFrame* self, HWND* win)
{
    HTML_TRACE("inplace_frame_GetWindow");
    *win = GetAncestor(MC_HTML_FROM_INPLACE_FRAME(self)->win, GA_ROOT);
    return(S_OK);
}
开发者ID:ArmstrongJ,项目名称:mctrl,代码行数:7,代码来源:html.c


示例4: IsShellWindow

bool IsShellWindow(HWND window)
{
    if(!IsWindow(window) || !IsWindowVisible(window))
    {
        return false;
    }
    if(GetAncestor(window, GA_PARENT) != GetDesktopWindow())
    {
        return false;
    }

    RECT clientRect;
    GetClientRect(window, &clientRect);
    if(clientRect.right - clientRect.left <= 1 || clientRect.bottom - clientRect.top <= 1)
    {
        return false;
    }
    
    char name[256] = {'\0'};
    GetWindowText(window, name, 256);
    String sName = name;
    if(sName.Length() == 0 || sName == "Start")
    {
        return false;
    }

    return true;
}
开发者ID:ElanHR,项目名称:Provincial,代码行数:28,代码来源:WindowsTasks.cpp


示例5: menubar_nccreate

static menubar_t*
menubar_nccreate(HWND win, CREATESTRUCT *cs)
{
    menubar_t* mb;
    TCHAR parent_class[16];

    MENUBAR_TRACE("menubar_nccreate(%p, %p)", win, cs);

    mb = (menubar_t*) malloc(sizeof(menubar_t));
    if(MC_ERR(mb == NULL)) {
        MC_TRACE("menubar_nccreate: malloc() failed.");
        return NULL;
    }

    memset(mb, 0, sizeof(menubar_t));
    mb->win = win;

    /* Lets be a little friendly to the app. developers: If the parent is
     * ReBar control, lets send WM_NOTIFY/WM_COMMAND to the ReBar's parent
     * as ReBar really is not interested in it, and embedding the menubar
     * in the ReBar is actually main advantage of this control in comparison
     * with the standard window menu. */
    GetClassName(cs->hwndParent, parent_class, MC_SIZEOF_ARRAY(parent_class));
    if(_tcscmp(parent_class, _T("ReBarWindow32")) == 0)
        mb->notify_win = GetAncestor(cs->hwndParent, GA_PARENT);
    else
        mb->notify_win = cs->hwndParent;

    mb->hot_item = -1;
    mb->pressed_item = -1;

    return mb;
}
开发者ID:Strongc,项目名称:mctrl,代码行数:33,代码来源:menubar.c


示例6: IsAltTabWindow

BOOL IsAltTabWindow(HWND hwnd)
{
    long wndStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
    if(GetWindowTextLength(hwnd) == 0)
        return false;

    // Ignore desktop window.
    if (hwnd == GetShellWindow())
        return(false);

    if(wndStyle & WS_EX_TOOLWINDOW)
        return(false);

    // Start at the root owner
    HWND hwndWalk = GetAncestor(hwnd, GA_ROOTOWNER);

    // See if we are the last active visible popup
    HWND hwndTry;
    while ((hwndTry = GetLastActivePopup(hwndWalk)) != hwndTry)
    {
        if (IsWindowVisible(hwndTry))
            break;
        hwndWalk = hwndTry;
    }
    return hwndWalk == hwnd;
}
开发者ID:jeffrimko,项目名称:QuickWin,代码行数:26,代码来源:mainwindow.cpp


示例7: is_alttab_window

// https://blogs.msdn.microsoft.com/oldnewthing/20071008-00/?p=24863/
static bool is_alttab_window(HWND const Window)
{
	if (!IsWindowVisible(Window))
		return false;

	auto Try = GetAncestor(Window, GA_ROOTOWNER);
	HWND Walk = nullptr;
	while (Try != Walk)
	{
		Walk = Try;
		Try = GetLastActivePopup(Walk);
		if (IsWindowVisible(Try))
			break;
	}
	if (Walk != Window)
		return false;

	// Tool windows should not be displayed either, these do not appear in the task bar
	if (GetWindowLongPtr(Window, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)
		return false;

	if (IsWindows8OrGreater())
	{
		int Cloaked = 0;
		if (SUCCEEDED(imports.DwmGetWindowAttribute(Window, DWMWA_CLOAKED, &Cloaked, sizeof(Cloaked))) && Cloaked)
			return false;
	}

	return true;
}
开发者ID:FarGroup,项目名称:FarManager,代码行数:31,代码来源:plist.cpp


示例8: EVENT_FocusIn

/**********************************************************************
 *              EVENT_FocusIn
 */
static void EVENT_FocusIn( HWND hwnd, XEvent *xev )
{
    XFocusChangeEvent *event = &xev->xfocus;
    XIC xic;

    if (!hwnd) return;

    TRACE( "win %p xwin %lx detail=%s\n", hwnd, event->window, focus_details[event->detail] );

    if (event->detail == NotifyPointer) return;

    if ((xic = X11DRV_get_ic( hwnd )))
    {
        wine_tsx11_lock();
        XSetICFocus( xic );
        wine_tsx11_unlock();
    }
    if (use_take_focus) return;  /* ignore FocusIn if we are using take focus */

    if (!can_activate_window(hwnd))
    {
        HWND hwnd = GetFocus();
        if (hwnd) hwnd = GetAncestor( hwnd, GA_ROOT );
        if (!hwnd) hwnd = GetActiveWindow();
        if (!hwnd) hwnd = x11drv_thread_data()->last_focus;
        if (hwnd && can_activate_window(hwnd)) set_focus( hwnd, CurrentTime );
    }
    else SetForegroundWindow( hwnd );
}
开发者ID:howard5888,项目名称:wineT,代码行数:32,代码来源:event.c


示例9: ui_window_lower

static int
ui_window_lower(lua_State* L)  /* emulate Alt-Esc. */
{
	HWND hwnd = NULL;
	HWND root;
	HWND next_hwnd;
	BOOL syncp = FALSE;
	Crj_ParseArgs(L, "| u Q", &hwnd, &syncp);
	hwnd = GetTargetWindow(hwnd);

	root = GetAncestor(hwnd, GA_ROOT);
	if (root != NULL)
		hwnd = root;

	if (!IsTopmostP(hwnd)) {
		if (hwnd == GetForegroundWindow()) {
			next_hwnd = GetNextAppWindow(hwnd, FALSE);
			if (next_hwnd != NULL)
				SetForegroundWindow(next_hwnd);
		}
		SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0,
		             (((!syncp) ? SWP_ASYNCWINDOWPOS : 0)
		              | SWP_NOACTIVATE
		              | SWP_NOMOVE
		              | SWP_NOOWNERZORDER
		              | SWP_NOSIZE));
	} else {
		if (hwnd == GetForegroundWindow()) {
			next_hwnd = GetNextAppWindow(hwnd, TRUE);
			if (next_hwnd != NULL)
				SetForegroundWindow(next_hwnd);
		}
	}
	return 0;
}
开发者ID:emonkak,项目名称:cereja,代码行数:35,代码来源:window.c


示例10: CursorProc

LRESULT CALLBACK CursorProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
  if (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN || msg == WM_RBUTTONDOWN) {
    ShowWindow(hwnd, SW_HIDE);
    HWND page = PropSheet_GetCurrentPageHwnd(g_cfgwnd);

    if (msg == WM_LBUTTONDOWN) {
      POINT pt;
      GetCursorPos(&pt);
      HWND window = WindowFromPoint(pt);
      window = GetAncestor(window, GA_ROOT);

      wchar_t title[256], classname[256];
      GetWindowText(window, title, ARRAY_SIZE(title));
      GetClassName(window, classname, ARRAY_SIZE(classname));

      wchar_t txt[1000];
      swprintf(txt, L"%s|%s", title, classname);
      SetDlgItemText(page, IDC_NEWRULE, txt);
    }

    // Show icon again
    ShowWindowAsync(GetDlgItem(page,IDC_FINDWINDOW), SW_SHOW);

    DestroyWindow(hwnd);
  }
  return DefWindowProc(hwnd, msg, wParam, lParam);
}
开发者ID:alex310110,项目名称:altdrag,代码行数:27,代码来源:config.c


示例11: CloseCurrentSession

INT_PTR CloseCurrentSession(WPARAM wparam,LPARAM lparam)
{
	HWND hWnd;
	int i=0;
	MessageWindowInputData  mwid;
	MessageWindowData  mwd;

	while(session_list[0]!=0)
	{
		mwid.cbSize = sizeof(MessageWindowInputData);
		mwid.hContact=session_list[i];
		mwid.uFlags=MSG_WINDOW_UFLAG_MSG_BOTH;

		mwd.cbSize = sizeof(MessageWindowData);
		mwd.hContact = mwid.hContact;
		mwd.uFlags=MSG_WINDOW_UFLAG_MSG_BOTH;
		CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid,(LPARAM)&mwd);

		if (g_mode)
		{
			hWnd=GetAncestor(mwd.hwndWindow,GA_ROOT);
			SendMessage(hWnd,WM_CLOSE,0,1);
		}
		else SendMessage(mwd.hwndWindow, WM_CLOSE, 0, 0);
	}
	ZeroMemory(session_list,SIZEOF(session_list));
	return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:28,代码来源:Main.cpp


示例12: WinPosActivateOtherWindow

/*******************************************************************
 *         WINPOS_ActivateOtherWindow
 *
 *  Activates window other than pWnd.
 */
void
WINAPI
WinPosActivateOtherWindow(HWND hwnd)
{
    HWND hwndTo, fg;

    if ((GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_POPUP) && (hwndTo = GetWindow( hwnd, GW_OWNER )))
    {
        hwndTo = GetAncestor( hwndTo, GA_ROOT );
        if (can_activate_window( hwndTo )) goto done;
    }

    hwndTo = hwnd;
    for (;;)
    {
        if (!(hwndTo = GetWindow( hwndTo, GW_HWNDNEXT ))) break;
        if (can_activate_window( hwndTo )) break;
    }

 done:
    fg = GetForegroundWindow();
    TRACE("win = %p fg = %p\n", hwndTo, fg);
    if (!fg || (hwnd == fg))
    {
        if (SetForegroundWindow( hwndTo )) return;
    }
    if (!SetActiveWindow( hwndTo )) SetActiveWindow(0);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:33,代码来源:winpos.c


示例13: MonthCalReload

static VOID
MonthCalReload(IN PMONTHCALWND infoPtr)
{
    WCHAR szBuf[64];
    UINT i;

    infoPtr->UIState = (DWORD)SendMessageW(GetAncestor(infoPtr->hSelf,
                                                       GA_PARENT),
                                            WM_QUERYUISTATE,
                                            0,
                                            0);

    /* Cache the configuration */
    infoPtr->FirstDayOfWeek = MonthCalFirstDayOfWeek();

    infoPtr->hbHeader = GetSysColorBrush(infoPtr->Enabled ? MONTHCAL_HEADERBG : MONTHCAL_DISABLED_HEADERBG);
    infoPtr->hbSelection = GetSysColorBrush(infoPtr->Enabled ? MONTHCAL_SELBG : MONTHCAL_DISABLED_SELBG);

    for (i = 0; i < 7; i++)
    {
        if (GetLocaleInfoW(LOCALE_USER_DEFAULT,
                           LOCALE_SABBREVDAYNAME1 +
                               ((i + infoPtr->FirstDayOfWeek) % 7),
                           szBuf,
                           sizeof(szBuf) / sizeof(szBuf[0])) != 0)
        {
            infoPtr->Week[i] = szBuf[0];
        }
    }

    /* Update the control */
    MonthCalUpdate(infoPtr);
}
开发者ID:GYGit,项目名称:reactos,代码行数:33,代码来源:monthcal.c


示例14: ui_window_raise

static int
ui_window_raise(lua_State* L)
{
	HWND hwnd = NULL;
	HWND rootowner;
	HWND lap;
	Crj_ParseArgs(L, "| u", &hwnd);
	hwnd = GetTargetWindow(hwnd);

	rootowner = GetAncestor(hwnd, GA_ROOTOWNER);
	if (rootowner != NULL)
		hwnd = rootowner;
	lap = GetLastActivePopup(hwnd);
	if (lap != NULL)
		hwnd = lap;

	if (hwnd != GetForegroundWindow()) {
		SetForegroundWindow(hwnd);
	} else {
		SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0,
		             (SWP_ASYNCWINDOWPOS
		              | SWP_NOACTIVATE
		              | SWP_NOMOVE
		              | SWP_NOOWNERZORDER
		              | SWP_NOSIZE));
	}
	return 0;
}
开发者ID:emonkak,项目名称:cereja,代码行数:28,代码来源:window.c


示例15: GetMainWindowHandle

HWND GetMainWindowHandle(DWORD processId) {
  if (!HeXModule()/* && !DesktopWidget()*/) {
    return FindWindow(GetMainWindowClassName(processId), NULL);
  }

  /*if (DesktopWidget()) {
    HWND desktop = FindWindow(L"Progman", NULL);
    desktop = GetWindow(desktop, GW_CHILD);
    HWND main_window = FindWindowEx(desktop, NULL,
        GetMainWindowClassName(processId), NULL);
    return main_window;
  }*/

  seekedHandle = NULL;  
  HWND topWindow = GetTopWindow(NULL);
  while (topWindow){
    DWORD pid = 0;
    DWORD threadId = GetWindowThreadProcessId(topWindow, &pid);
    if (threadId != 0 && pid == processId) {
      EnumChildWindows(topWindow, EnumChildBrowserProc, (LPARAM)pid);
      if (seekedHandle) {
        return GetAncestor(seekedHandle, GA_ROOT);
      }
    }
    topWindow = GetNextWindow(topWindow, GW_HWNDNEXT);
  }
  return NULL;
}
开发者ID:276361270,项目名称:hex,代码行数:28,代码来源:hex_shared_win.cpp


示例16: test1

void test1()
{
	HWND hWnd = HWND(0x00010412);
	HWND hAncestorWnd = GetAncestor(hWnd, GA_ROOTOWNER);
	CString strDebug;
	strDebug.Format("hWnd = %08X, hAncestorWnd = %08X\n", hWnd, hAncestorWnd);
	g_pMainWin->Log(strDebug);
}
开发者ID:harrysun2006,项目名称:07_ShellHook,代码行数:8,代码来源:MainDlg.cpp


示例17: DIALOG_EnableOwner

/***********************************************************************
 *           DIALOG_EnableOwner
 *
 * Helper function for modal dialogs to enable again the
 * owner of the dialog box.
 */
static void DIALOG_EnableOwner( HWND hOwner )
{
    /* Owner must be a top-level window */
    if (hOwner)
        hOwner = GetAncestor( hOwner, GA_ROOT );
    if (!hOwner) return;
    EnableWindow( hOwner, TRUE );
}
开发者ID:AlexSteel,项目名称:wine,代码行数:14,代码来源:dialog.c


示例18: send_mouse_input

/***********************************************************************
 *		send_mouse_input
 *
 * Update the various window states on a mouse event.
 */
static void send_mouse_input( HWND hwnd, UINT flags, Window window, int x, int y,
                              unsigned int state, DWORD mouse_data, Time time )
{
    struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
    POINT pt;
    INPUT input;

    if (!data) return;

    if (window == data->whole_window)
    {
        x += data->whole_rect.left - data->client_rect.left;
        y += data->whole_rect.top - data->client_rect.top;
    }
    if (window == root_window)
    {
        x += virtual_screen_rect.left;
        y += virtual_screen_rect.top;
    }
    pt.x = x;
    pt.y = y;
    if (GetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL)
        pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x;
    MapWindowPoints( hwnd, 0, &pt, 1 );

    if (InterlockedExchangePointer( (void **)&cursor_window, hwnd ) != hwnd ||
        GetTickCount() - last_time_modified > 100)
    {
        cursor_window = hwnd;
        sync_window_cursor( data );
    }
    last_time_modified = GetTickCount();

    if (hwnd != GetDesktopWindow()) hwnd = GetAncestor( hwnd, GA_ROOT );

    /* update the wine server Z-order */

    if (window != x11drv_thread_data()->grab_window &&
        /* ignore event if a button is pressed, since the mouse is then grabbed too */
        !(state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask|Button6Mask|Button7Mask)))
    {
        RECT rect;
        SetRect( &rect, pt.x, pt.y, pt.x + 1, pt.y + 1 );
        MapWindowPoints( 0, hwnd, (POINT *)&rect, 2 );

        SERVER_START_REQ( update_window_zorder )
        {
            req->window      = wine_server_user_handle( hwnd );
            req->rect.left   = rect.left;
            req->rect.top    = rect.top;
            req->rect.right  = rect.right;
            req->rect.bottom = rect.bottom;
            wine_server_call( req );
        }
        SERVER_END_REQ;
    }
开发者ID:dvdhoo,项目名称:wine,代码行数:61,代码来源:mouse.c


示例19: SetFocus

/*****************************************************************
 *		SetFocus  ([email protected])
 */
HWND WINAPI SetFocus( HWND hwnd )
{
    HWND hwndTop = hwnd;
    HWND previous = GetFocus();

    TRACE( "%p prev %p\n", hwnd, previous );

    if (hwnd)
    {
        /* Check if we can set the focus to this window */
        hwnd = WIN_GetFullHandle( hwnd );
        if (!IsWindow( hwnd ))
        {
            SetLastError( ERROR_INVALID_WINDOW_HANDLE );
            return 0;
        }
        if (hwnd == previous) return previous;  /* nothing to do */
        for (;;)
        {
            HWND parent;
            LONG style = GetWindowLongW( hwndTop, GWL_STYLE );
            if (style & (WS_MINIMIZE | WS_DISABLED)) return 0;
            if (!(style & WS_CHILD)) break;
            parent = GetAncestor( hwndTop, GA_PARENT );
            if (!parent || parent == GetDesktopWindow())
            {
                if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return 0;
                break;
            }
            if (parent == get_hwnd_message_parent()) return 0;
            hwndTop = parent;
        }

        /* call hooks */
        if (HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)hwnd, (LPARAM)previous, TRUE )) return 0;

        /* activate hwndTop if needed. */
        if (hwndTop != GetActiveWindow())
        {
            if (!set_active_window( hwndTop, NULL, FALSE, FALSE )) return 0;
            if (!IsWindow( hwnd )) return 0;  /* Abort if window destroyed */

            /* Do not change focus if the window is no longer active */
            if (hwndTop != GetActiveWindow()) return 0;
        }
    }
    else /* NULL hwnd passed in */
    {
        if (!previous) return 0;  /* nothing to do */
        if (HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, 0, (LPARAM)previous, TRUE )) return 0;
    }

    /* change focus and send messages */
    return set_focus_window( hwnd );
}
开发者ID:elppans,项目名称:wine-staging-1.9.15_IndexVertexBlending-1.9.11,代码行数:58,代码来源:focus.c


示例20: test_CShellMenu_with_DeskBar

void test_CShellMenu_with_DeskBar(IShellFolder *shellFolder, HMENU hmenu)
{
    HRESULT hResult;
    IShellMenu* shellMenu;
    IDockingWindow* dockingMenu;
    IObjectWithSite *menuWithSite;
    IMenuPopup* menuPopup;
    IBandSite* bandSite;

    /* Create the tree objects and query the nescesary interfaces */
    BOOL bCreated = CreateCShellMenu(&shellMenu, &dockingMenu, &menuWithSite);
    hResult = CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER, IID_IMenuPopup, reinterpret_cast<void **>(&menuPopup));
    test_S_OK(hResult, "Failed to instantiate CLSID_MenuDeskBar");
    hResult = CoCreateInstance(CLSID_MenuBandSite, NULL, CLSCTX_INPROC_SERVER, IID_IBandSite, reinterpret_cast<void **>(&bandSite));
    test_S_OK(hResult, "Failed to instantiate CLSID_MenuBandSite");
    if (!bCreated || !menuPopup || !bandSite)
    {
        skip("failed to create MenuBandSite object\n");
        return;
    }
    
    /* Create the popup menu */
    hResult = shellMenu->Initialize(NULL, 0, ANCESTORDEFAULT, SMINIT_TOPLEVEL|SMINIT_VERTICAL); 
    test_S_OK(hResult, "Initialize failed");
    hResult = shellMenu->SetMenu( hmenu, NULL, SMSET_TOP);
    test_S_OK(hResult, "SetMenu failed");
    hResult = menuPopup->SetClient(bandSite);
    test_S_OK(hResult, "SetClient failed");
    hResult = bandSite->AddBand(shellMenu);
    test_S_OK(hResult, "AddBand failed");

    /* Show the popum menu */
    POINTL p = {10,10};
    hResult = menuPopup->Popup(&p, NULL, 0);
    test_HRES(hResult, S_FALSE, "Popup failed");

    HWND hWndToolbar, hWndToplevel;

    /* Ensure that the created windows are correct */
    hResult = dockingMenu->GetWindow(&hWndToolbar);
    test_S_OK(hResult, "GetWindow failed");    
    ok(hWndToolbar != NULL, "GetWindow should return a window\n");

    hResult = menuPopup->GetWindow(&hWndToplevel);
    test_S_OK(hResult, "GetWindow failed");
    ok(hWndToolbar != NULL, "GetWindow should return a window\n");

    HWND hwndRealParent = GetParent(hWndToolbar);
    ok(GetParent(hwndRealParent) == hWndToplevel, "Wrong parent\n");
    ok(CheckWindowClass(hWndToolbar, L"ToolbarWindow32"), "Wrong class\n");
    ok(CheckWindowClass(hwndRealParent, L"MenuSite"), "Wrong class\n");
    ok(CheckWindowClass(hWndToplevel, L"BaseBar"), "Wrong class\n");

    ok(GetAncestor (hWndToplevel, GA_PARENT) == GetDesktopWindow(), "Expected the BaseBar window to be top level\n");
}
开发者ID:Moteesh,项目名称:reactos,代码行数:55,代码来源:menu.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetAngle函数代码示例发布时间:2022-05-30
下一篇:
C++ GetAlpha函数代码示例发布时间: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