internal void SetFocus() { if (activeObject != null) { IntPtr hWnd; if (activeObject.GetWindow(out hWnd) == Interop.S_OK) { Win32.SetFocus(hWnd); } } }
internal void SetFocus() { if (activeObject != null) { IntPtr hWnd = IntPtr.Zero; if (activeObject.GetWindow(out hWnd) == Interop.S_OK) { Debug.Assert(hWnd != IntPtr.Zero); Interop.SetFocus(hWnd); } } }
void Interop.IOleInPlaceFrame.SetActiveObject(Interop.IOleInPlaceActiveObject pActiveObject, string pszObjName) { try { if (pActiveObject == null) { if (this.activeObject != null) { Marshal.ReleaseComObject(this.activeObject); } this.activeObject = null; this.windowHandle = IntPtr.Zero; } else { this.activeObject = pActiveObject; this.windowHandle = new IntPtr(); pActiveObject.GetWindow(out this.windowHandle); } } catch { } }