-
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace mpvnet
|
||||
{
|
||||
@@ -36,25 +34,5 @@ namespace mpvnet
|
||||
{
|
||||
Native.AdjustWindowRect(ref rc, (uint)Native.GetWindowLongPtrW(hwnd, -16 /* GWL_STYLE */), false);
|
||||
}
|
||||
|
||||
public static string GetAssociatedApplication(string ext)
|
||||
{
|
||||
uint returnValue = 0U;
|
||||
// ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE
|
||||
if (1 == Native.AssocQueryString(0x40, 2, ext, null, null, ref returnValue))
|
||||
{
|
||||
if (returnValue > 0)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(Convert.ToInt32(returnValue));
|
||||
// ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE
|
||||
if (0 == Native.AssocQueryString(0x40, 2, ext, null, sb, ref returnValue))
|
||||
{
|
||||
var ret = sb.ToString();
|
||||
if (File.Exists(ret)) return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user