Exemplo n.º 1
0
/*-----------------------------------------------------------------------------
  Find the top-level and document windows for the browser
-----------------------------------------------------------------------------*/
bool CPagetestBase::FindBrowserWindows(DWORD process_id, HWND& frame_window, 
                          HWND& document_window) {
  bool found = false;
  // find a known document window that belongs to this process
  document_window = FindDocumentWindow(process_id, ::GetDesktopWindow());
  if (document_window) {
    found = true;
    frame_window = GetAncestor(document_window, GA_ROOTOWNER);
  }
  return found;
}
Exemplo n.º 2
0
/*-----------------------------------------------------------------------------
  Recursively find the highest visible window for the fiven process
-----------------------------------------------------------------------------*/
HWND CPagetestBase::FindDocumentWindow(DWORD process_id, HWND parent) {
  HWND document_window = NULL;
  HWND wnd = ::GetWindow(parent, GW_CHILD);
  while (wnd && !document_window) {
    if (IsWindowVisible(wnd)) {
      DWORD pid;
      GetWindowThreadProcessId(wnd, &pid);
      if (pid == process_id && IsBrowserDocument(wnd)) {
        document_window = wnd;
      } else {
        document_window = FindDocumentWindow(process_id, wnd);
      }
    }
    wnd = ::GetNextWindow(wnd , GW_HWNDNEXT);
  }
  return document_window;
}
Exemplo n.º 3
0
void CAddinApp::OnCommand(UINT id)
{
	switch (id)
	{
	case ID_ShowSheetWindow:
		{
			IVWindowPtr window = GetValidActiveWindow(visDrawing);

			if (!window)
				return;

			ShowShapeSheetWatchWindow(window, !IsShapeSheetWatchWindowShown(window));
			break;
		}

	case ID_AddWatch:
		{
			IVWindowPtr sheet_window = GetValidActiveWindow(visSheet);

			if (!sheet_window)
				return;

			IVCellPtr selected_cell = sheet_window->GetSelectedCell();
			if (selected_cell)
			{
				IVWindowPtr window = FindDocumentWindow(selected_cell);

				if (window)
				{
					CVisioFrameWnd* wnd = 
						ShowShapeSheetWatchWindow(window, true);

					GetViewSettings()->AddCellMask(selected_cell->Name);
					UpdateViews(UpdateOption_Hilight|UpdateOption_UseKey);
				}
			}
		}
	}
}