support shortcuts with media file target

This commit is contained in:
stax76
2022-07-11 06:14:01 +02:00
parent f719528017
commit ec17ae8ce9
3 changed files with 14 additions and 2 deletions

View File

@@ -1202,8 +1202,11 @@ namespace mpvnet
string ext = file.Ext();
if (ext == "avs")
LoadAviSynth();
switch (ext)
{
case "avs": LoadAviSynth(); break;
case "lnk": file = GetShortcutTarget(file); break;
}
if (ext == "iso")
LoadISO(file);
@@ -1461,6 +1464,13 @@ namespace mpvnet
return name;
}
public static string GetShortcutTarget(string path)
{
Type t = Type.GetTypeFromProgID("WScript.Shell");
dynamic sh = Activator.CreateInstance(t);
return sh.CreateShortcut(path).TargetPath;
}
public void RaiseScaleWindow(float value) => ScaleWindow(value);
public void RaiseWindowScaleNET(float value) => WindowScaleNET(value);