Widow – Diff between revs 21 and 24

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 21 Rev 24
Line 123... Line 123...
123 if (!Natives.GetWindowRect(e.Handle, out var rect)) 123 if (!Natives.GetWindowRect(e.Handle, out var rect))
124 { 124 {
125 return; 125 return;
126 } 126 }
Line -... Line 127...
-   127  
-   128 var process = string.Empty;
-   129 try
127   130 {
-   131 process = Helpers.GetProcessName(e.Handle);
-   132 }
-   133 catch
-   134 {
-   135 return;
-   136 }
128 var process = Helpers.GetProcessName(e.Handle); 137  
129 if (string.IsNullOrEmpty(process)) 138 if (string.IsNullOrEmpty(process))
130 { 139 {
131 return; 140 return;
Line 383... Line 392...
383   392  
384 private void GlobalMouseHook_MouseClick(object sender, MouseEventArgs e) 393 private void GlobalMouseHook_MouseClick(object sender, MouseEventArgs e)
385 { 394 {
386 var hWnd = Natives.WindowFromPoint(new Point(e.X, e.Y)); 395 var hWnd = Natives.WindowFromPoint(new Point(e.X, e.Y));
-   396 Natives.GetWindowThreadProcessId(hWnd, out var pid);
-   397 Process process;
-   398 try
387 Natives.GetWindowThreadProcessId(hWnd, out var pid); 399 {
-   400 process = Process.GetProcessById((int) pid);
-   401 }
-   402 catch
-   403 {
-   404 return;
-   405 }
388 var process = Process.GetProcessById((int) pid); 406  
389 var windowTitle = Helpers.GetWindowTitle(process.MainWindowHandle); 407 var windowTitle = Helpers.GetWindowTitle(process.MainWindowHandle);
390 if (string.IsNullOrEmpty(windowTitle)) 408 if (string.IsNullOrEmpty(windowTitle))
391 { 409 {
392 return; 410 return;