File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
src/Starward/Features/ViewHost Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 66using Starward . Features . Setting ;
77using Starward . Frameworks ;
88using Starward . Helpers ;
9- using System ;
10- using System . IO ;
119using Vanara . PInvoke ;
1210using Windows . Foundation ;
1311
@@ -68,11 +66,9 @@ private void SetTrayIcon()
6866 {
6967 try
7068 {
71- string icon = Path . Combine ( AppContext . BaseDirectory , "Assets" , "logo.ico" ) ;
72- if ( File . Exists ( icon ) )
73- {
74- trayIcon . Icon = new ( icon ) ;
75- }
69+ nint hInstance = Kernel32 . GetModuleHandle ( null ) . DangerousGetHandle ( ) ;
70+ nint hIcon = User32 . LoadIcon ( hInstance , "#32512" ) . DangerousGetHandle ( ) ;
71+ trayIcon . Icon = System . Drawing . Icon . FromHandle ( hIcon ) ;
7672 }
7773 catch { }
7874 }
Original file line number Diff line number Diff line change @@ -88,10 +88,10 @@ private void InitializeDefaultUserDataFolder()
8888 }
8989 else
9090 {
91- #if DEBUG || DEV
91+ #if DEBUG
9292 UserDataFolder = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "Starward" ) ;
9393#else
94- UserDataFolder = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "Starward" ) ;
94+ UserDataFolder = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) , "Starward" ) ;
9595#endif
9696 }
9797 }
You can’t perform that action at this time.
0 commit comments