这篇教程C++ GetAncestor函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetAncestor函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAncestor函数的具体用法?C++ GetAncestor怎么用?C++ GetAncestor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetAncestor函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetAncestorHWND 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,
示例2: onWM_COMMANDstatic 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,
示例3: inplace_frame_GetWindowstatic HRESULT STDMETHODCALLTYPEinplace_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,
示例4: IsShellWindowbool 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,
示例5: menubar_nccreatestatic 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,
示例6: IsAltTabWindowBOOL 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,
示例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,
示例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,
示例9: ui_window_lowerstatic intui_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,
示例10: CursorProcLRESULT 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,
示例11: CloseCurrentSessionINT_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,
示例12: WinPosActivateOtherWindow/******************************************************************* * WINPOS_ActivateOtherWindow * * Activates window other than pWnd. */voidWINAPIWinPosActivateOtherWindow(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,
示例13: MonthCalReloadstatic VOIDMonthCalReload(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,
示例14: ui_window_raisestatic intui_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,
示例15: GetMainWindowHandleHWND 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,
示例16: test1void 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,
示例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,
示例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,
|