コード例 #1
0
HWND FindProjectComboBox( void )
{
	EnumChildWindows( ghDeveloperStudioWnd, (WNDENUMPROC) EnumComboCbck, 0L );
	if( (!ghProjectComboBox) || (!IsWindow( ghProjectComboBox ) ) )
		EnumChildWindows( GetDesktopWindow(), (WNDENUMPROC) EnumComboCbck, 0L );
	return ghProjectComboBox;
}
コード例 #2
0
ファイル: TaskManager.cpp プロジェクト: psouza4/ZHider
VOID FindProcessesWindow(HWND hWndStart)
{
	g_Processes = NULL;
	EnumChildWindows(hWndStart, FindProcessesWindowEnum, NULL);
	if (g_Processes != NULL)
		EnumChildWindows(g_Processes, FindProcessesChildWindowEnum, NULL);
}
コード例 #3
0
ファイル: DBListBuilder.cpp プロジェクト: sylarhl/sqlgoy
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
0
ファイル: screen_shot.cpp プロジェクト: luobende/gadgets
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
0
ファイル: ImportOptionsDlg.cpp プロジェクト: xt9852/KeePassXT
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
0
ファイル: Win32Wnd.cpp プロジェクト: dreamsxin/ultimatepp
void DumpWindowOrder(bool aliens) {
#ifndef PLATFORM_WINCE
	LLOG("DumpWindowOrder" << BeginIndent);
	EnumChildWindows(NULL, &sDumpWindow, (LPARAM)(aliens ? 1 : 0));
	LLOG(EndIndent << "//DumpWindowOrder");
#endif
}
コード例 #7
0
ファイル: Main.cpp プロジェクト: scut-luo/Computation
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
0
ファイル: hex_shared_win.cpp プロジェクト: 276361270/hex
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
0
ファイル: LogHelper.cpp プロジェクト: dariner/TiebaManager
// 初始化
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
0
ファイル: win_funcs.c プロジェクト: AssetsInc/EventGhost
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
0
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
0
ファイル: classPsTreeItem.cpp プロジェクト: Seldom/miranda-ng
/**
 * 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
0
ファイル: enumwin.c プロジェクト: richardneish/ltrdata
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
0
ファイル: enumwin.c プロジェクト: richardneish/ltrdata
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
0
ファイル: dbgeemsg.c プロジェクト: ABratovic/open-watcom-v2
/*
 * 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 );

}
コード例 #16
0
//************************************
// Method:    LoadProcessWindow
// FullName:  ProcessWindowCollection::LoadProcessWindow
// Access:    public 
// Returns:   bool
// Qualifier:
// Parameter: HWND hNewWindow_i
// Parameter: const DWORD dwWindowThreadId_i
//************************************
bool ProcessWindowCollection::LoadProcessWindow( HWND hNewWindow_i )
{
    // Prepare window data
    PWindow pWindow = new Window;

    // Window details
    pWindow->ExtractWindowDetails( hNewWindow_i );

    // Get parent child map
    WindowMap& wmWndMap = GetWindowMap();

    PWindow pParentWindow = 0;
    if( wmWndMap.Lookup( pWindow->GetParentHandle(), pParentWindow ) && pParentWindow )
    {
        // Add this window to the list of child windows of parent window
        pParentWindow->GetChildWindowList().AddTail( pWindow );
    }
    else
    {
        // Add to main window list
        GetProcessWindowList().AddTail( pWindow );
    }// End if

    // Insert item to map
    wmWndMap[pWindow->GetHandle()] = pWindow;

    // Get all child windows for this window
    EnumChildWindows( hNewWindow_i, 
					  EnumerateChildWindowsCB, 
					  reinterpret_cast<LPARAM>( &wmWndMap ));

    // We want more
    return TRUE;
}
コード例 #17
0
ファイル: ImageWnd.cpp プロジェクト: mar80nik/Tracker
void ImageWnd::OnChildMove()
{
	int n=GetWindowedChildCount();
	HWNDArray childs; childs.Add((HWND)n); childs.Add(m_hWnd);
	CRect result,tr,cr; GetClientRect(&cr);

	while(EnumChildWindows(m_hWnd, EnumChildProc,(LPARAM)&childs));
	int i=2; CWnd* twnd=NULL;
	if( (childs.GetCount()-2)>0 )
	{
		twnd=CWnd::FromHandle(childs[i++]);
		twnd->GetWindowRect(&tr); result.UnionRect(tr,tr);
		for(;i<childs.GetCount();i++)
		{
			
			twnd=CWnd::FromHandle(childs[i]);
			CString T; twnd->GetWindowText(T);
			twnd->GetWindowRect(&tr); 
			result.UnionRect(result,tr);
		}
	}
	CPoint tl=result.TopLeft(), br=result.BottomRight();
	ScreenToClient(&tl); ScreenToClient(&br);
	result=CRect(tl,br);
	if(cr.top!=result.top || cr.bottom!=result.bottom || cr.left!=result.left || cr.right!=result.right)
	{
		SetWindowPos(NULL,result.left,result.top,result.Width(),result.Height(), SWP_NOZORDER );
	}
}
コード例 #18
0
ファイル: wclickat.c プロジェクト: GYGit/reactos
static BOOL CALLBACK find_top_window(HWND hwnd, LPARAM lParam)
{
    WCHAR str[1024];
    HWND* pwindow;

    if (!GetClassNameW(hwnd, str, ARRAY_LENGTH(str)) ||
        lstrcmpiW(str, g_window_class))
        return TRUE;

    if (!GetWindowTextW(hwnd, str, ARRAY_LENGTH(str)) ||
        lstrcmpiW(str, g_window_title))
        return TRUE;

    /* Check that the window is visible and active */
    if (!g_disabled)
    {
        DWORD style = GetWindowStyle(hwnd);
        if (!(style & WS_VISIBLE) || (style &  WS_DISABLED))
            return TRUE;
    }

    /* See if we find the control we want */
    if (g_control_class)
    {
        HWND control = NULL;
        EnumChildWindows(hwnd, find_control, (LPARAM)&control);
        if (!control)
            return TRUE;
        hwnd=control;
    }

    pwindow = (HWND*)lParam;
    *pwindow = hwnd;
    return FALSE;
}
コード例 #19
0
ファイル: Win32Wnd.cpp プロジェクト: koz4k/soccer
void DumpWindowOrder(bool aliens) {
#ifndef PLATFORM_WINCE
	LLOG("DumpWindowOrder" << LOG_BEGIN);
	EnumChildWindows(NULL, &sDumpWindow, (LPARAM)(aliens ? 1 : 0));
	LLOG(LOG_END << "//DumpWindowOrder");
#endif
}
コード例 #20
0
ファイル: AutoSelectMode.cpp プロジェクト: hlyces/teamtalk_TT
BOOL AutoSelectMode::snapshotWindows()
{
	for (HWND hWnd = GetTopWindow(NULL); NULL != hWnd; hWnd = GetWindow(hWnd, GW_HWNDNEXT))
	{
		if (!IsWindow(hWnd)
			|| !IsWindowVisible(hWnd)
			|| IsIconic(hWnd))
		{
			continue;
		}
		EnumChildWindows(hWnd, [](HWND hwnd, LPARAM lParam)->BOOL{
			if (!IsWindow(hwnd)
				|| !IsWindowVisible(hwnd)
				|| IsIconic(hwnd))
			{
				return TRUE;
			}
			RECT rcWnd = { 0 };
			GetWindowRect(hwnd, &rcWnd);
			
			if (ScreenCommon::isRectEmpty(rcWnd))
			{
				return TRUE;
			}

			wchar_t szTxt[MAX_PATH] = { 0 };
			GetWindowText(hwnd, szTxt, MAX_PATH);
			if (wcslen(szTxt) <= 0)
			{
				//continue;
			}

			//combine the rect with the screen rect
			AutoSelectMode* pThis = (AutoSelectMode*)lParam;
			pThis->m_lsWndList.push_back(ScreenCaptureWndInfo(hwnd, rcWnd));
			return TRUE;
		}, (LPARAM)this);
		

		RECT rcWnd = { 0 };
		GetWindowRect(hWnd, &rcWnd);
		adjustRectInScreen(rcWnd);
		if (ScreenCommon::isRectEmpty(rcWnd))
		{
			continue;
		}

		wchar_t szTxt[MAX_PATH] = { 0 };
		GetWindowText(hWnd, szTxt, MAX_PATH);
		if (wcslen(szTxt) <= 0)
		{
			//continue;
		}

		//combine the rect with the screen rect
		m_lsWndList.push_back(ScreenCaptureWndInfo(hWnd, rcWnd));
	}

	return m_lsWndList.size() > 0;
}
コード例 #21
0
ファイル: propBasic.c プロジェクト: songbei6/WinObjEx64
/*
* propBasicQueryDevice
*
* Purpose:
*
* Set information values for Device object type
*
*/
VOID propBasicQueryDevice(
    _In_ PROP_OBJECT_INFO *Context,
    _In_ HWND hwndDlg
)
{
    RECT    rGB;
    LPWSTR  lpItemText;

    if (Context == NULL) {
        return;
    }

    //
    // For performance reasons instead of query again
    // we use description from main object list.
    //
    lpItemText = Context->lpDescription;
    if (lpItemText) {
        //show hidden controls
        if (GetWindowRect(GetDlgItem(hwndDlg, ID_DEVICEINFO), &rGB)) {
            EnumChildWindows(hwndDlg, supEnumEnableChildWindows, (LPARAM)&rGB);
        }
        SetDlgItemText(hwndDlg, ID_DEVICEDESCRIPTION, lpItemText);
    }
}
コード例 #22
0
int DoMyControlProcessing(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam,INT_PTR *bReturn)
{
	switch(message) {
		case WM_INITDIALOG:
			EnumChildWindows(hdlg,MyControlsEnumChildren,0);
			if(hEmfHeaderLogo==NULL) {
				HRSRC hRsrc=FindResourceA(hInst,MAKEINTRESOURCEA(IDE_HDRLOGO),"EMF");
				HGLOBAL hGlob=LoadResource(hInst,hRsrc);
				hEmfHeaderLogo=SetEnhMetaFileBits(SizeofResource(hInst,hRsrc),(PBYTE)LockResource(hGlob));
			}
			SendDlgItemMessage(hdlg,IDC_HDRLOGO,STM_SETIMAGE,IMAGE_ENHMETAFILE,(LPARAM)hEmfHeaderLogo);
			break;
		case WM_CTLCOLORSTATIC:
			if((GetWindowLong((HWND)lParam,GWL_STYLE)&0xFFFF)==0) {
				char szText[256];
				GetWindowTextA((HWND)lParam,szText,sizeof(szText));
				if(!strcmp(szText,"whiterect")) {
					SetTextColor((HDC)wParam,RGB(255,255,255));
					SetBkColor((HDC)wParam,RGB(255,255,255));
					SetBkMode((HDC)wParam,OPAQUE);
					*bReturn=(INT_PTR)GetStockObject(WHITE_BRUSH);
					return TRUE;
				}
				else {
					SetBkMode((HDC)wParam,TRANSPARENT);
					*bReturn=(INT_PTR)GetStockObject(NULL_BRUSH);
					return TRUE;
				}
			}
			break;
	}
	return FALSE;
}
コード例 #23
0
void BiliPlayer::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	// TODO:  在此处添加消息处理程序代码
	EnumChildWindows(m_hWnd, EnumChildWindowsProc, -1);
	// 不为绘图消息调用 CDialogEx::OnPaint()
}
コード例 #24
0
ファイル: shortcut.cpp プロジェクト: quachdnguyen/locate-src
LPWSTR CSubAction::GetPathFromExplorer()
{
	if (!IsUnicodeSystem())
	{
		// Global shortcuts won't even work in non-unicode systems
		return NULL;
	}

	HWND hCurWindow=GetForegroundWindow();
	char szClass[100]="";
	GetClassName(hCurWindow,szClass,100);
	
	if (strcmp(szClass,"ExploreWClass")!=0  && // WinXP
		strcmp(szClass,"CabinetWClass")!=0)  // WinNT
		return NULL;
	
	WCHAR* pPath=new WCHAR[MAX_PATH];
	pPath[0]='\0';
	EnumChildWindows(hCurWindow,EnumExplorerChilds,(LPARAM)pPath);

	if (pPath[0]=='\0')
	{
		delete[] pPath;
		return NULL;
	}
	return pPath;
}
コード例 #25
0
ファイル: WidgetObject.c プロジェクト: thomasfuhringer/oxygen
BOOL
OxWidget_ReleaseChildren(OxWidgetObject* ox)
{
	if (ox->hWin)
		EnumChildWindows(ox->hWin, OxWidgetReleaseEnumProc, 0);
	return TRUE;
}
コード例 #26
0
ファイル: AnsiDbg.cpp プロジェクト: Alexander-Shukaev/ConEmu
BOOL CALLBACK EnumMinTTY(HWND hwnd, LPARAM lParam)
{
	if (hMinTTY)
		return FALSE;
	LPDWORD pdw = (LPDWORD)lParam;
	TCHAR szClass[100] = _T("");
	if (GetClassName(hwnd, szClass, 100))
	{
		if (lstrcmp(szClass, _T("mintty")) == 0)
		{
			DWORD nPID, nTID = GetWindowThreadProcessId(hwnd, &nPID);
			while (*pdw)
			{
				if (*pdw == nPID)
				{
					hMinTTY = hwnd;
					return FALSE; // stop
				}
				pdw++;
			}
		}
		else if (lstrcmp(szClass, _T("VirtualConsoleClass")) == 0)
		{
			EnumChildWindows(hwnd, EnumMinTTY, lParam);
		}
	}
	return TRUE; // continue
}
コード例 #27
0
ファイル: jabber_search.cpp プロジェクト: raoergsls/miranda
static void JabberSearchFreeData(HWND hwndDlg, JabberSearchData * dat)
{
	//lock
	if ( !dat->fSearchRequestIsXForm && dat->nJSInfCount && dat->pJSInf ) {
		for ( int i=0; i < dat->nJSInfCount; i++ ) {
			if (dat->pJSInf[i].hwndValueItem)
				DestroyWindow(dat->pJSInf[i].hwndValueItem);
			if (dat->pJSInf[i].hwndCaptionItem)
				DestroyWindow(dat->pJSInf[i].hwndCaptionItem);
			if (dat->pJSInf[i].szFieldCaption)
				free(dat->pJSInf[i].szFieldCaption);
			if (dat->pJSInf[i].szFieldName)
				free(dat->pJSInf[i].szFieldName);
		}
		free(dat->pJSInf);
		dat->pJSInf=NULL;
	}
	else EnumChildWindows(GetDlgItem(hwndDlg,IDC_FRAME),DeleteChildWindowsProc,0);			

	if ( dat->xNode )
		xi.destroyNode( dat->xNode );

	SendMessage(GetDlgItem(hwndDlg,IDC_FRAME), WM_SETFONT, (WPARAM) SendMessage( hwndDlg, WM_GETFONT, 0, 0 ),0 );
	dat->nJSInfCount=0;
	ShowWindow(GetDlgItem(hwndDlg,IDC_VSCROLL),SW_HIDE);
	SetDlgItemText(hwndDlg,IDC_INSTRUCTIONS,TranslateT("Select/type search service URL above and press <Go>"));
	//unlock
}
コード例 #28
0
ファイル: SearchCtrl.cpp プロジェクト: michaellukashov/ConEmu
void EditIconHint_Subclass(HWND hDlg, HWND hRootDlg /*= NULL*/)
{
	if (!hRootDlg)
		hRootDlg = hDlg;

	EnumChildWindows(hDlg, EditIconHint_Enum, (LPARAM)hRootDlg);
}
コード例 #29
0
// --------------------------------------------------------------------------
void CToolTipWnd::OnTimer( UINT nIDEvent ) 
{
	if (nIDEvent == ID_TIMER_TOOLTIP_HIDE)
	{
		KillTimer();
		KillShowTimer();
		ShowWindow(SW_HIDE);

	}
	else if (nIDEvent == ID_TIMER_TOOLTIP_SHOW)
	{
		POINT pt;

		// Where is the mouse right now?
		if (GetCursorPos(&pt))
		{
			// Over which window?
			CWnd* pWnd = WindowFromPoint(pt);

			// Save the relevant window handles
			TTWNDSTRUCT ws;
			ZeroMemory(&ws, sizeof(ws));
			ws.hWndToolTip = GetSafeHwnd();
			ws.hWndToolTipParent = pWnd->GetSafeHwnd();

			// Now do the window handle comparisons
			EnumChildWindows(m_hParentWnd, EnumChildProc, (LPARAM)&ws); 
		}
 
	}


	CWnd::OnTimer(nIDEvent);
}
コード例 #30
-1
BOOL CFindInDbDlg::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_SEARCH),
		KCSB_ICON_LEFT | KCSB_ICON_VCENTER);
	m_banner.SetTitle(TRL("Find"));
	m_banner.SetCaption(TRL("Find a string in the entry list."));

	if(m_lpGroupName != NULL)
	{
		CString str;

		str = TRL("Find"); str += _T(" - "); str += TRL("Group:");
		str += _T(" "); str += m_lpGroupName;
		m_banner.SetTitle(str);

		GetDlgItem(IDC_CHECK_GROUPNAME)->EnableWindow(FALSE);
		GetDlgItem(IDC_CHECK_EXCLUDEBACKUPS)->EnableWindow(FALSE);
	}

	GetDlgItem(IDC_EDIT_FINDTEXT)->SetFocus();
	return FALSE; // Return TRUE unless you set the focus to a control
}