diff --git a/demo/Skylark.WinForms.Demo/WinFormsDemoWallpaper/WinFormsDemoWallpaper/WinFormsDemoWallpaper.csproj b/demo/Skylark.WinForms.Demo/WinFormsDemoWallpaper/WinFormsDemoWallpaper/WinFormsDemoWallpaper.csproj index 85ae704b..8424f732 100644 --- a/demo/Skylark.WinForms.Demo/WinFormsDemoWallpaper/WinFormsDemoWallpaper/WinFormsDemoWallpaper.csproj +++ b/demo/Skylark.WinForms.Demo/WinFormsDemoWallpaper/WinFormsDemoWallpaper/WinFormsDemoWallpaper.csproj @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/src/Skylark.Clipboard/Skylark.Clipboard.csproj b/src/Skylark.Clipboard/Skylark.Clipboard.csproj index 9d477fb9..56872e0e 100644 --- a/src/Skylark.Clipboard/Skylark.Clipboard.csproj +++ b/src/Skylark.Clipboard/Skylark.Clipboard.csproj @@ -50,7 +50,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All diff --git a/src/Skylark.DNS/Skylark.DNS.csproj b/src/Skylark.DNS/Skylark.DNS.csproj index b98fdfec..f5820943 100644 --- a/src/Skylark.DNS/Skylark.DNS.csproj +++ b/src/Skylark.DNS/Skylark.DNS.csproj @@ -49,7 +49,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All diff --git a/src/Skylark.Standard/Skylark.Standard.csproj b/src/Skylark.Standard/Skylark.Standard.csproj index 8e68cf59..ee4b171c 100644 --- a/src/Skylark.Standard/Skylark.Standard.csproj +++ b/src/Skylark.Standard/Skylark.Standard.csproj @@ -49,7 +49,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All diff --git a/src/Skylark.Uptime/Skylark.Uptime.cs b/src/Skylark.Uptime/Skylark.Uptime.cs index c7deaaa1..76501247 100644 --- a/src/Skylark.Uptime/Skylark.Uptime.cs +++ b/src/Skylark.Uptime/Skylark.Uptime.cs @@ -15,7 +15,7 @@ // Creator: Taiizor // Website: www.vegalya.com // Created: 27.Feb.2023 -// Changed: 10.Oct.2024 +// Changed: 23.Oct.2024 // Version: 3.1.5.4 // // |---------DO-NOT-REMOVE---------| diff --git a/src/Skylark.Uptime/Skylark.Uptime.csproj b/src/Skylark.Uptime/Skylark.Uptime.csproj index 133f25dd..15e3ce68 100644 --- a/src/Skylark.Uptime/Skylark.Uptime.csproj +++ b/src/Skylark.Uptime/Skylark.Uptime.csproj @@ -49,7 +49,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All diff --git a/src/Skylark.Wing/Helper/ShortcutBasic.cs b/src/Skylark.Wing/Helper/ShortcutBasic.cs index 42d255dc..ce1b7bb1 100644 --- a/src/Skylark.Wing/Helper/ShortcutBasic.cs +++ b/src/Skylark.Wing/Helper/ShortcutBasic.cs @@ -44,32 +44,33 @@ public static void Create(string linkFileName, string targetPath, string working string iconLocation = string.Format("{0},{1}", targetPath, iconNumber); #if NET6_0_OR_GREATER - Type shellType = SWMI.M_TYPE; dynamic shell = SWMI.M_SHELL; dynamic shortcut = shell.CreateShortcut(linkFileName); - shortcut.TargetPath = targetPath; - shortcut.WorkingDirectory = workingDirectory; - shortcut.Arguments = arguments; shortcut.Hotkey = hotkey; - shortcut.WindowStyle = shortcutWindowStyle; + shortcut.Arguments = arguments; + shortcut.TargetPath = targetPath; shortcut.Description = description; shortcut.IconLocation = iconLocation; + shortcut.WindowStyle = shortcutWindowStyle; + shortcut.WorkingDirectory = workingDirectory; shortcut.Save(); #else Type shellType = SWMI.M_TYPE; + object shell = SWMI.M_SHELL; object shortcut = shellType.InvokeMethod("CreateShortcut", shell, linkFileName); + Type shortcutType = shortcut.GetType(); - shortcutType.InvokeSetMember("TargetPath", shortcut, targetPath); - shortcutType.InvokeSetMember("WorkingDirectory", shortcut, workingDirectory); - shortcutType.InvokeSetMember("Arguments", shortcut, arguments); shortcutType.InvokeSetMember("Hotkey", shortcut, hotkey); - shortcutType.InvokeSetMember("WindowStyle", shortcut, shortcutWindowStyle); + shortcutType.InvokeSetMember("Arguments", shortcut, arguments); + shortcutType.InvokeSetMember("TargetPath", shortcut, targetPath); shortcutType.InvokeSetMember("Description", shortcut, description); shortcutType.InvokeSetMember("IconLocation", shortcut, iconLocation); + shortcutType.InvokeSetMember("WindowStyle", shortcut, shortcutWindowStyle); + shortcutType.InvokeSetMember("WorkingDirectory", shortcut, workingDirectory); shortcutType.InvokeMethod("Save", shortcut); #endif diff --git a/src/Skylark.Wing/Helper/ShortcutRuntime.cs b/src/Skylark.Wing/Helper/ShortcutRuntime.cs index 06861db9..14a1cb4d 100644 --- a/src/Skylark.Wing/Helper/ShortcutRuntime.cs +++ b/src/Skylark.Wing/Helper/ShortcutRuntime.cs @@ -26,15 +26,16 @@ public static class ShortcutRuntime public static void Create(string shortcutLocation, string shortcutName, string description, string hotkey, string targetPath, string iconLocation = null, string workingDirectory = null, string arguments = null, SWNM.WindowStyle windowStyle = SWNM.WindowStyle.Normal) { WshShell shell = new(); + string shortcutAddress = Path.Combine(shortcutLocation, shortcutName); IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress); shortcut.Description = description; shortcut.TargetPath = targetPath; - if (hotkey != null) + if (workingDirectory != null) { - shortcut.Hotkey = hotkey; + shortcut.WorkingDirectory = workingDirectory; } if (iconLocation != null) @@ -42,17 +43,18 @@ public static void Create(string shortcutLocation, string shortcutName, string d shortcut.IconLocation = iconLocation; } - if (workingDirectory != null) + if (arguments != null) { - shortcut.WorkingDirectory = workingDirectory; + shortcut.Arguments = arguments; } - if (arguments != null) + if (hotkey != null) { - shortcut.Arguments = arguments; + shortcut.Hotkey = hotkey; } shortcut.WindowStyle = (int)windowStyle; + shortcut.Save(); } } diff --git a/src/Skylark.Wing/Skylark.Wing.cs b/src/Skylark.Wing/Skylark.Wing.cs index de399630..1a0c6ed5 100644 --- a/src/Skylark.Wing/Skylark.Wing.cs +++ b/src/Skylark.Wing/Skylark.Wing.cs @@ -21,8 +21,8 @@ // Creator: Taiizor // Website: www.vegalya.com // Created: 17.Jun.2023 -// Changed: 10.Oct.2024 -// Version: 3.1.6.8 +// Changed: 23.Oct.2024 +// Version: 3.1.6.9 // // |---------DO-NOT-REMOVE---------| diff --git a/src/Skylark.Wing/Skylark.Wing.csproj b/src/Skylark.Wing/Skylark.Wing.csproj index 722ab697..73fb3a29 100644 --- a/src/Skylark.Wing/Skylark.Wing.csproj +++ b/src/Skylark.Wing/Skylark.Wing.csproj @@ -12,7 +12,7 @@ Resources\Skylark.Wing.ico - 3.1.6.8 + 3.1.6.9 $(Version) true Skylark.Wing @@ -51,7 +51,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All @@ -77,7 +77,7 @@ - + diff --git a/src/Skylark/Skylark.cs b/src/Skylark/Skylark.cs index f54cb003..a5c13305 100644 --- a/src/Skylark/Skylark.cs +++ b/src/Skylark/Skylark.cs @@ -12,7 +12,7 @@ // Creator: Taiizor // Website: www.vegalya.com // Created: 03.Jan.2023 -// Changed: 10.Oct.2024 +// Changed: 23.Oct.2024 // Version: 3.1.4.9 // // |---------DO-NOT-REMOVE---------| diff --git a/src/Skylark/Skylark.csproj b/src/Skylark/Skylark.csproj index 0569f7a2..70a63db1 100644 --- a/src/Skylark/Skylark.csproj +++ b/src/Skylark/Skylark.csproj @@ -49,7 +49,7 @@ - 9.0.0-beta.24508.2 + 9.0.0-beta.24522.2 All