We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9f8ca01 + bbe8a32 commit e739f4eCopy full SHA for e739f4e
Source/ExcelDna.IntelliSense/Win32Helper.cs
@@ -133,7 +133,7 @@ public static IntPtr GetFocusedWindowHandle()
133
var info = new GUITHREADINFO();
134
info.cbSize = Marshal.SizeOf(info);
135
if (!GetGUIThreadInfo(0, ref info))
136
- throw new Win32Exception();
+ return IntPtr.Zero;
137
138
var focusedWindow = info.hwndFocus;
139
if (focusedWindow == IntPtr.Zero)
@@ -142,7 +142,7 @@ public static IntPtr GetFocusedWindowHandle()
142
uint processId;
143
uint threadId = GetWindowThreadProcessId(focusedWindow, out processId);
144
if (threadId == 0)
145
146
147
uint currentProcessId = GetCurrentProcessId();
148
if (processId == currentProcessId)
0 commit comments