mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Need to use active window
This commit is contained in:
parent
c289dfd124
commit
cf30a7d949
2 changed files with 4 additions and 2 deletions
|
@ -101,8 +101,7 @@ public string FileName
|
|||
/// <returns>True if the user presses OK else false</returns>
|
||||
public bool ShowDialog()
|
||||
{
|
||||
IntPtr activeWindow = NativeMethods.GetForegroundWindow();
|
||||
return ShowDialog(activeWindow);
|
||||
return ShowDialog(NativeMethods.GetActiveWindow());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -85,6 +85,9 @@ public static partial class NativeMethods
|
|||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr FindWindowEx(IntPtr parentHwnd, IntPtr childAfterHwnd, IntPtr className, string windowText);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr GetActiveWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
|
||||
|
||||
|
|
Loading…
Reference in a new issue