File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 22
22
using UniGetUI . Core . SettingsEngine ;
23
23
using UniGetUI . PackageEngine . PackageClasses ;
24
24
using UniGetUI . Core . Tools ;
25
+ using System . Runtime . InteropServices ;
26
+ using System . Reflection . Metadata ;
25
27
26
28
27
29
namespace UniGetUI . Interface
28
30
{
29
31
public sealed partial class MainWindow : Window
30
32
{
33
+ [ DllImport ( "user32.dll" ) ]
34
+ [ return : MarshalAs ( UnmanagedType . Bool ) ] static extern bool SetForegroundWindow ( IntPtr hWnd ) ;
35
+
31
36
[ System . Runtime . InteropServices . ComImport ]
32
37
[ System . Runtime . InteropServices . Guid ( "3A3DCD6C-3EAB-43DC-BCDE-45671CE800C8" ) ]
33
38
[ System . Runtime . InteropServices . InterfaceType (
@@ -226,6 +231,7 @@ private void LoadTrayMenu()
226
231
ShowHideCommand . ExecuteRequested += ( s , e ) =>
227
232
{
228
233
Activate ( ) ;
234
+ SetForegroundWindow ( GetWindowHandle ( ) ) ;
229
235
} ;
230
236
231
237
TrayIcon . LeftClickCommand = ShowHideCommand ;
@@ -235,6 +241,7 @@ private void LoadTrayMenu()
235
241
UpdateSystemTrayStatus ( ) ;
236
242
}
237
243
244
+
238
245
public void UpdateSystemTrayStatus ( )
239
246
{
240
247
string modifier = "_empty" ;
You can’t perform that action at this time.
0 commit comments