mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 01:39:17 +01:00
Minor tweak
This commit is contained in:
parent
b3c9796fbb
commit
710c820539
@ -476,15 +476,12 @@ namespace DS4Windows
|
|||||||
|
|
||||||
public static string ResolveShortcut(string filePath)
|
public static string ResolveShortcut(string filePath)
|
||||||
{
|
{
|
||||||
// IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model"
|
|
||||||
//IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
|
|
||||||
Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object
|
Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object
|
||||||
dynamic shell = Activator.CreateInstance(t);
|
dynamic shell = Activator.CreateInstance(t);
|
||||||
string result;
|
string result;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
|
|
||||||
var shortcut = shell.CreateShortcut(filePath);
|
var shortcut = shell.CreateShortcut(filePath);
|
||||||
result = shortcut.TargetPath;
|
result = shortcut.TargetPath;
|
||||||
Marshal.FinalReleaseComObject(shortcut);
|
Marshal.FinalReleaseComObject(shortcut);
|
||||||
@ -504,15 +501,12 @@ namespace DS4Windows
|
|||||||
|
|
||||||
public static string ResolveShortcutAndArgument(string filePath)
|
public static string ResolveShortcutAndArgument(string filePath)
|
||||||
{
|
{
|
||||||
// IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model"
|
|
||||||
//IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
|
|
||||||
Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object
|
Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8")); // Windows Script Host Shell Object
|
||||||
dynamic shell = Activator.CreateInstance(t);
|
dynamic shell = Activator.CreateInstance(t);
|
||||||
string result;
|
string result;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
|
|
||||||
var shortcut = shell.CreateShortcut(filePath);
|
var shortcut = shell.CreateShortcut(filePath);
|
||||||
result = shortcut.TargetPath + " " + shortcut.Arguments;
|
result = shortcut.TargetPath + " " + shortcut.Arguments;
|
||||||
Marshal.FinalReleaseComObject(shortcut);
|
Marshal.FinalReleaseComObject(shortcut);
|
||||||
|
Loading…
Reference in New Issue
Block a user