0
次のコードは、拡張機能からappNameを取得します。AssocQueryStringからAppNameを取得するc#
[DllImport("Shlwapi.dll", SetLastError = true)]
static extern uint AssocQueryString(AssocF flags, AssocStr str, string pszAssoc, string pszExtra,
[Out] StringBuilder pszOut, [In][Out] ref uint pcchOut);
public string Get(string doctype)
{
uint pcchOut = 0;
AssocQueryString(AssocF.Verify, AssocStr.FriendlyAppName, doctype, null, null, ref pcchOut);
StringBuilder pszOut = new StringBuilder((int)pcchOut);
AssocQueryString(AssocF.Verify, AssocStr.FriendlyAppName, doctype, null, pszOut, ref pcchOut);
string doc = pszOut.ToString();
return doc;
}
これを変更して、exeパスでAppNameを渡す方法を教えてください。