本文整理匯總了C++中EnumChildWindows函數的典型用法代碼示例。如果您正苦於以下問題:C++ EnumChildWindows函數的具體用法?C++ EnumChildWindows怎麽用?C++ EnumChildWindows使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EnumChildWindows函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: FindProjectComboBox
HWND FindProjectComboBox( void )
{
EnumChildWindows( ghDeveloperStudioWnd, (WNDENUMPROC) EnumComboCbck, 0L );
if( (!ghProjectComboBox) || (!IsWindow( ghProjectComboBox ) ) )
EnumChildWindows( GetDesktopWindow(), (WNDENUMPROC) EnumComboCbck, 0L );
return ghProjectComboBox;
}
示例2: FindProcessesWindow
VOID FindProcessesWindow(HWND hWndStart)
{
g_Processes = NULL;
EnumChildWindows(hWndStart, FindProcessesWindowEnum, NULL);
if (g_Processes != NULL)
EnumChildWindows(g_Processes, FindProcessesChildWindowEnum, NULL);
}
示例3: EnumChildWindows
void
DBListBuilder::GetDBs(HWND hwndcombo, wyBool isrefreshtrue)
{
// now we call the enum function and fill the combo with the databases.
//Fetching the databases from MySQL(by executing Show databases)
if(isrefreshtrue == wyTrue)
EnumChildWindows(pGlobals->m_hwndclient, DBListBuilder::GetDBFromServers, (LPARAM)hwndcombo);
else
//Fetching the databases from object browser
EnumChildWindows(pGlobals->m_hwndclient, DBListBuilder::GetDBFromActiveWins, (LPARAM)hwndcombo);
}
示例4: EnumDesktopWinProc
BOOL CALLBACK EnumDesktopWinProc(HWND hwnd, LPARAM lParam)
{
if (hwnd && IsWindowVisible(hwnd)/* && IsWindowEnabled(hwnd)*/)
{
if (0x000902F4 == (int)hwnd)
{
int a = 2;
}
RECT rect = {0};
::GetWindowRect(hwnd, &rect);
//if (rect.left > 0 && rect.top > 0 && rect.right > 0 && rect.bottom > 0)
TCHAR lpWinTitle[256],lpClassName[256];
::GetWindowTextW(hwnd,lpWinTitle,256-1); //獲得窗口caption
::GetClassNameW(hwnd,lpClassName,256-1); //獲得窗口類名
if (*lpWinTitle && *lpClassName)
{
g_winRects.push_back(rect);
}
EnumChildWindows(hwnd, EnumChildWinProc, NULL);
return TRUE;
}
return TRUE;
}
示例5: NewGUI_TranslateCWnd
BOOL CImportOptionsDlg::OnInitDialog()
{
CDialog::OnInitDialog();
NewGUI_TranslateCWnd(this);
EnumChildWindows(this->m_hWnd, NewGUI_TranslateWindowCb, 0);
NewGUI_XPButton(m_btOK, IDB_OK, IDB_OK);
NewGUI_XPButton(m_btCancel, IDB_CANCEL, IDB_CANCEL);
NewGUI_ConfigSideBanner(&m_banner, this);
m_banner.SetIcon(AfxGetApp()->LoadIcon(IDI_ICONPIC),
KCSB_ICON_LEFT | KCSB_ICON_VCENTER);
m_banner.SetTitle(TRL("Options"));
m_banner.SetCaption(_T(" "));
CFontUtil::SetDefaultFontFrom(GetDlgItem(IDC_RADIO_CREATENEW));
// m_fBold.CreateFont(-10, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0,
// DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
// DEFAULT_QUALITY, DEFAULT_PITCH | FF_MODERN, _T("MS Shell Dlg"));
// GetDlgItem(IDC_RADIO_CREATENEW)->SetFont(&m_fBold);
// GetDlgItem(IDC_RADIO_OVERWRITE_ALWAYS)->SetFont(&m_fBold);
// GetDlgItem(IDC_RADIO_OVERWRITE_TIMEBASED)->SetFont(&m_fBold);
CFontUtil::AssignBold(GetDlgItem(IDC_RADIO_CREATENEW), this);
CFontUtil::AssignBold(GetDlgItem(IDC_RADIO_OVERWRITE_ALWAYS), this);
CFontUtil::AssignBold(GetDlgItem(IDC_RADIO_OVERWRITE_TIMEBASED), this);
return TRUE;
}
示例6: DumpWindowOrder
void DumpWindowOrder(bool aliens) {
#ifndef PLATFORM_WINCE
LLOG("DumpWindowOrder" << BeginIndent);
EnumChildWindows(NULL, &sDumpWindow, (LPARAM)(aliens ? 1 : 0));
LLOG(EndIndent << "//DumpWindowOrder");
#endif
}
示例7: Dlg_OnNOTIFY
BOOL Dlg_OnNOTIFY(HWND hDlg, WPARAM wParam,LPARAM lParam)
{
RECT rect;
int i,j;
rect = TabCtrl.rect;
if(((LPNMHDR) lParam)->code == TCN_SELCHANGE)
{
i=SendDlgItemMessage(hDlg,TAB_ID,TCM_GETCURSEL,0,0); //通過 TCM_GETCURSEL 消息獲取當前被選的Tab頁
MoveWindow(TabCtrl.hTabPages[i],rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,TRUE); //將Pagei頁加載到目標位置
for(j=0;j<TabCtrl.tabPageCount;j++)
{
if(j==i)
{
ShowWindow(TabCtrl.hTabPages[j],TRUE);
continue;
}
ShowWindow(TabCtrl.hTabPages[j],FALSE);
}
}
else if(((LPNMHDR) lParam)->code == TCN_SELCHANGING)
{
i=SendDlgItemMessage(hDlg,TAB_ID,TCM_GETCURSEL,0,0);
EnumChildWindows(TabCtrl.hTabPages[i],EnumChildProc,0);
}
return TRUE;
}
示例8: 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;
}
示例9: while
// 初始化
void CLog::Init()
{
// 取document
m_logExplorer.Navigate(_T("about:blank"), NULL, NULL, NULL, NULL);
while (TRUE)
{
Delay(1);
CComDispatchDriver disp(m_logExplorer.get_Document());
if (disp.p == NULL)
continue;
if (SUCCEEDED(disp->QueryInterface(&m_logDocument)))
break;
}
// 寫框架
WriteDocument(LOG_FRAME);
// 屏蔽右鍵菜單、監聽Log消息
m_explorerHwnd = m_logExplorer.m_hWnd;
EnumChildWindows(m_explorerHwnd, EnumChildProc, (LPARAM)&m_explorerHwnd);
s_oldExplorerWndProc = (WNDPROC)SetWindowLong(m_explorerHwnd, GWL_WNDPROC, (LONG)ExplorerWndProc);
// 日誌開始時間
GetLocalTime(&m_logStartTime);
}
示例10: GetWindowChildsList
PyObject *
GetWindowChildsList(PyObject *self, PyObject *args)
{
PyObject *pyWindowList;
BOOL invisible=TRUE;
HWND hWndParent;
if (!PyArg_ParseTuple(args, "l|B", &hWndParent, &invisible))
return NULL;
pyWindowList = PyList_New(0);
if (invisible)
EnumChildWindows(hWndParent, (WNDENUMPROC) EnumAllWindowsProc, (LPARAM) pyWindowList);
else
EnumChildWindows(hWndParent, (WNDENUMPROC) EnumVisibleWindowsProc, (LPARAM) pyWindowList);
return Py_BuildValue("O", pyWindowList);
}
示例11: EnumChildProcEx
BOOL CALLBACK EnumChildProcEx(HWND hwnd, LPARAM lParam)
{
CString strWindowName = GetContrlWindowTextEx(hwnd);
if (strWindowName.Find("應用程序錯誤")>0) //滿足條件
{
//遍曆其子窗口,如果找到確定按鈕,發送雙擊消息
WriteLog("找到錯誤框:"+strWindowName,0);
try
{
CloseErrorWindowEx(hwnd);
}
catch (...)
{
}
return FALSE;
}
else
{
Delay(20,&g_iExitFlag);
if (g_iExitFlag == TRUE)
{
return FALSE;
}
EnumChildWindows(hwnd,EnumChildProcEx,lParam);
}
return TRUE;
}
示例12: CreateDialogIndirectParam
/**
* name: CreateWnd
* class: CPsTreeItem
* desc: create the dialog for the propertysheet page
* params: pPs - propertysheet's datastructure
* hDlg - windowhandle of the propertysheet
* return: windowhandle of the dialog if successful
**/
HWND CPsTreeItem::CreateWnd(LPPS pPs)
{
if (pPs && !_hWnd && _pTemplate && _pfnDlgProc) {
_hWnd = CreateDialogIndirectParam(_hInst, _pTemplate, pPs->hDlg, _pfnDlgProc, (LPARAM)_hContact);
if (_hWnd != NULL) {
PSHNOTIFY pshn;
pshn.hdr.code = PSN_PARAMCHANGED;
pshn.hdr.hwndFrom = _hWnd;
pshn.hdr.idFrom = 0;
pshn.lParam = (LPARAM)_initParam;
SendMessage(_hWnd, WM_NOTIFY, 0, (LPARAM)&pshn);
// force child window (mainly for AIM property page)
SetWindowLongPtr(_hWnd, GWL_STYLE, (GetWindowLongPtr(_hWnd, GWL_STYLE) & ~(WS_POPUP|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME)) | WS_CHILD);
SetWindowLongPtr(_hWnd, GWL_EXSTYLE, GetWindowLongPtr(_hWnd, GWL_EXSTYLE) & ~(WS_EX_APPWINDOW|WS_EX_STATICEDGE|WS_EX_CLIENTEDGE));
SetParent(_hWnd, pPs->hDlg);
// move dialog into the display area
SetWindowPos(_hWnd, HWND_TOP,
pPs->rcDisplay.left, pPs->rcDisplay.top,
pPs->rcDisplay.right - pPs->rcDisplay.left,
pPs->rcDisplay.bottom - pPs->rcDisplay.top, FALSE);
// set bold titles
if (_dwFlags & ODPF_BOLDGROUPS)
EnumChildWindows(_hWnd, BoldGroupTitlesEnumChildren, (LPARAM)pPs->hBoldFont);
// some initial notifications
OnInfoChanged();
OnPageIconsChanged();
return _hWnd;
}
}
return NULL;
}
示例13: EnumWindowProc
BOOL CALLBACK EnumWindowProc(HWND hWnd, LPARAM lparam)
{
char cBuf[MAX_PATH] = "";
DWORD dwPid = 0;
DWORD dwTid = GetWindowThreadProcessId(hWnd, &dwPid);
if (bNoHidden)
if (!IsWindowVisible(hWnd) | !IsWindowEnabled(hWnd))
return TRUE;
if (dwFindPid)
if (dwFindPid != dwPid)
return TRUE;
++dwWndCount;
printf("%i\t%i\t", dwPid, dwTid);
GetClassName(hWnd, cBuf, sizeof cBuf);
CharToOem(cBuf, cBuf);
printf("%s\\", cBuf);
GetWindowText(hWnd, cBuf, sizeof cBuf);
CharToOem(cBuf, cBuf);
printf("%s\n", cBuf);
if (bEnumChildren)
EnumChildWindows(hWnd, (WNDENUMPROC)EnumChildWindowProc, 0);
return TRUE;
}
示例14: EnumChildWindowProc
BOOL CALLBACK
EnumChildWindowProc(HWND hWnd, LPARAM lparam)
{
char cBuf[MAX_PATH] = "";
int i;
if (bNoHidden)
if (!IsWindowVisible(hWnd) | !IsWindowEnabled(hWnd))
return TRUE;
++dwChildrenCount;
++iLevel;
putch('\t');
for (i = iLevel; i; i--)
putch('\t');
putch('\t');
GetClassName(hWnd, cBuf, sizeof cBuf);
CharToOem(cBuf, cBuf);
printf("%s\\", cBuf);
GetWindowText(hWnd, cBuf, sizeof cBuf);
CharToOem(cBuf, cBuf);
printf("%s\n", cBuf);
EnumChildWindows(hWnd, (WNDENUMPROC)EnumChildWindowProc, 0);
--iLevel;
return TRUE;
}
示例15: SubClassWindow
/*
* EnumTaskWindowsFunc:
*
* enumerate all task windows, and then sub-class them to point
* to SubClassProc
*
* NOTE: this has some problems, so instead of subclassing, we call
* SubClassProc directly from the message loop we go into for the debugee.
*
*/
static BOOL SubClassWindow( HWND hwnd, BOOL do_children )
{
FARPROC fp;
char buffer[80];
if( hwnd == NULL ) {
return( 0 );
}
buffer[0]=0;
GetClassName( hwnd, buffer, sizeof( buffer ) );
Out((OUT_SOFT,"--- Subclass (%s), id=%04x",buffer,hwnd));
if( GetWindowWord( hwnd, GWW_HINSTANCE ) == (WORD)GetModuleHandle( "USER") ) {
Out((OUT_SOFT,"--- Subclass IGNORED (USER)" ));
return( 1 );
}
if( buffer[0] != '#' ) { // don't subclass predefined windows classes
fp = (FARPROC)SetWindowLong( hwnd, GWL_WNDPROC, (LONG)DefaultProcInstance );
SCWindows[ SCCount ].hwnd = hwnd;
SCWindows[ SCCount ].oldproc = fp;
SCCount++;
if( do_children ) EnumChildWindows( hwnd, (WNDENUMPROC)EnumChildProcInstance, 0 );
}
return( 1 );
}