mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Delete more stuff
This commit is contained in:
@@ -211,34 +211,6 @@ namespace Microsoft.WindowsAPICodePack.Taskbar
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the application user model id for an individual window
|
||||
/// </summary>
|
||||
/// <param name="appId">The app id to set</param>
|
||||
/// <param name="windowHandle">Window handle for the window that needs a specific application id</param>
|
||||
/// <remarks>AppId specifies a unique Application User Model ID (AppID) for the application or individual
|
||||
/// top-level window whose taskbar button will hold the custom JumpList built through the methods <see cref="Microsoft.WindowsAPICodePack.Taskbar.JumpList"/> class.
|
||||
/// By setting an appId for a specific window, the window will not be grouped with it's parent window/application. Instead it will have it's own taskbar button.</remarks>
|
||||
public void SetApplicationIdForSpecificWindow(IntPtr windowHandle, string appId)
|
||||
{
|
||||
// Left as instance method, to follow singleton pattern.
|
||||
TaskbarNativeMethods.SetWindowAppId(windowHandle, appId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the application user model id for a given window
|
||||
/// </summary>
|
||||
/// <param name="appId">The app id to set</param>
|
||||
/// <param name="window">Window that needs a specific application id</param>
|
||||
/// <remarks>AppId specifies a unique Application User Model ID (AppID) for the application or individual
|
||||
/// top-level window whose taskbar button will hold the custom JumpList built through the methods <see cref="Microsoft.WindowsAPICodePack.Taskbar.JumpList"/> class.
|
||||
/// By setting an appId for a specific window, the window will not be grouped with it's parent window/application. Instead it will have it's own taskbar button.</remarks>
|
||||
public void SetApplicationIdForSpecificWindow(System.Windows.Window window, string appId)
|
||||
{
|
||||
// Left as instance method, to follow singleton pattern.
|
||||
TaskbarNativeMethods.SetWindowAppId((new WindowInteropHelper(window)).Handle, appId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the current process' explicit application user model id.
|
||||
/// </summary>
|
||||
|
||||
@@ -128,59 +128,6 @@ namespace Microsoft.WindowsAPICodePack.Taskbar
|
||||
|
||||
[DllImport("user32.dll", EntryPoint = "RegisterWindowMessage", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern uint RegisterWindowMessage([MarshalAs(UnmanagedType.LPWStr)] string lpString);
|
||||
|
||||
[DllImport("shell32.dll")]
|
||||
public static extern int SHGetPropertyStoreForWindow(
|
||||
IntPtr hwnd,
|
||||
ref Guid iid /*IID_IPropertyStore*/,
|
||||
[Out(), MarshalAs(UnmanagedType.Interface)]out IPropertyStore propertyStore);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the window's application id by its window handle.
|
||||
/// </summary>
|
||||
/// <param name="hwnd">The window handle.</param>
|
||||
/// <param name="appId">The application id.</param>
|
||||
internal static void SetWindowAppId(IntPtr hwnd, string appId)
|
||||
{
|
||||
SetWindowProperty(hwnd, SystemProperties.System.AppUserModel.ID, appId);
|
||||
}
|
||||
|
||||
internal static void SetWindowProperty(IntPtr hwnd, PropertyKey propkey, string value)
|
||||
{
|
||||
// Get the IPropertyStore for the given window handle
|
||||
IPropertyStore propStore = GetWindowPropertyStore(hwnd);
|
||||
|
||||
// Set the value
|
||||
using (PropVariant pv = new PropVariant(value))
|
||||
{
|
||||
HResult result = propStore.SetValue(ref propkey, pv);
|
||||
if (!CoreErrorHelper.Succeeded(result))
|
||||
{
|
||||
throw new ShellException(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Dispose the IPropertyStore and PropVariant
|
||||
Marshal.ReleaseComObject(propStore);
|
||||
}
|
||||
|
||||
internal static IPropertyStore GetWindowPropertyStore(IntPtr hwnd)
|
||||
{
|
||||
IPropertyStore propStore;
|
||||
Guid guid = new Guid(ShellIIDGuid.IPropertyStore);
|
||||
int rc = SHGetPropertyStoreForWindow(
|
||||
hwnd,
|
||||
ref guid,
|
||||
out propStore);
|
||||
if (rc != 0)
|
||||
{
|
||||
throw Marshal.GetExceptionForHR(rc);
|
||||
}
|
||||
return propStore;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -78,11 +79,20 @@
|
||||
<Link>Properties\SolutionAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="AnimatedGifWindow.cs" />
|
||||
<Compile Include="AnimatedGifWindowWinForms.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AuthenticodeTools.cs" />
|
||||
<Compile Include="CopStache.cs" />
|
||||
<Compile Include="Mono.Options\Options.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TaskbarCOMInterfaces.cs" />
|
||||
<Compile Include="TaskbarEnums.cs" />
|
||||
<Compile Include="TaskbarInterfaces.cs" />
|
||||
<Compile Include="TaskbarList.cs" />
|
||||
<Compile Include="TaskbarManager.cs" />
|
||||
<Compile Include="TaskbarNativeMethods.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
||||
Reference in New Issue
Block a user