2014-03-19 04:05:27 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2014-03-30 11:16:44 +08:00
|
|
|
|
using System.Text;
|
2014-03-19 04:05:27 +08:00
|
|
|
|
|
2015-01-03 15:20:34 +08:00
|
|
|
|
namespace Wox.Plugin.Program.ProgramSources
|
2014-03-19 04:05:27 +08:00
|
|
|
|
{
|
2014-12-15 22:58:49 +08:00
|
|
|
|
[Serializable]
|
2014-03-19 04:05:27 +08:00
|
|
|
|
[global::System.ComponentModel.Browsable(false)]
|
|
|
|
|
public class CommonStartMenuProgramSource : FileSystemProgramSource
|
|
|
|
|
{
|
|
|
|
|
[DllImport("shell32.dll")]
|
|
|
|
|
static extern bool SHGetSpecialFolderPath(IntPtr hwndOwner, [Out] StringBuilder lpszPath, int nFolder, bool fCreate);
|
|
|
|
|
const int CSIDL_COMMON_PROGRAMS = 0x17;
|
|
|
|
|
|
|
|
|
|
private static string getPath()
|
|
|
|
|
{
|
|
|
|
|
StringBuilder commonStartMenuPath = new StringBuilder(560);
|
|
|
|
|
SHGetSpecialFolderPath(IntPtr.Zero, commonStartMenuPath, CSIDL_COMMON_PROGRAMS, false);
|
|
|
|
|
|
|
|
|
|
return commonStartMenuPath.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CommonStartMenuProgramSource()
|
|
|
|
|
: base(getPath())
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-23 16:17:41 +08:00
|
|
|
|
public CommonStartMenuProgramSource(ProgramSource source)
|
2014-03-19 04:05:27 +08:00
|
|
|
|
: this()
|
|
|
|
|
{
|
2014-03-19 20:16:20 +08:00
|
|
|
|
this.BonusPoints = source.BonusPoints;
|
2014-03-19 04:05:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
2014-03-19 20:16:20 +08:00
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return typeof(CommonStartMenuProgramSource).Name;
|
|
|
|
|
}
|
2014-03-19 04:05:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|