Skip to content

Commit

Permalink
Lister form has an owner.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderPro committed Jun 20, 2019
1 parent 8d5fdbb commit 867e6fa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Wlx2Explorer/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ private void ShowListerForm()
}
else
{
_listerForm.Show();
var foregroundWindowHandle = NativeMethods.GetForegroundWindow();
_listerForm.Show(new Win32WindowWrapper(foregroundWindowHandle));
_listerForm.Activate();
}
}
Expand Down
18 changes: 18 additions & 0 deletions Wlx2Explorer/Win32WindowWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Wlx2Explorer
{
class Win32WindowWrapper : IWin32Window
{
public IntPtr Handle { get; private set; }

public Win32WindowWrapper(IntPtr handle)
{
Handle = handle;
}
}
}
1 change: 1 addition & 0 deletions Wlx2Explorer/Wlx2Explorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win32WindowWrapper.cs" />
<EmbeddedResource Include="Forms\AboutForm.resx">
<DependentUpon>AboutForm.cs</DependentUpon>
</EmbeddedResource>
Expand Down

0 comments on commit 867e6fa

Please sign in to comment.