Allow to minimize the client by Crtl+Click on its thumbnail

This commit is contained in:
Anton Kasyanov
2017-06-17 18:45:15 +03:00
parent 1fe2023b51
commit 5277a52bae
4 changed files with 134 additions and 95 deletions

View File

@@ -227,6 +227,7 @@ namespace EveOPreview.UI
view.ThumbnailFocused = this.ThumbnailViewFocused;
view.ThumbnailLostFocus = this.ThumbnailViewLostFocus;
view.ThumbnailActivated = this.ThumbnailActivated;
view.ThumbnailDeactivated = this.ThumbnailDeactivated;
view.RegisterHotkey(this._configuration.GetClientHotkey(processTitle));
@@ -353,6 +354,29 @@ namespace EveOPreview.UI
view?.Refresh(true);
}
private void ThumbnailDeactivated(IntPtr id)
{
IThumbnailView view;
this._thumbnailViews.TryGetValue(id, out view);
if (view?.Id == this._activeClientHandle)
{
WindowManagerNativeMethods.SendMessage(view.Id, WindowManagerNativeMethods.WM_SYSCOMMAND, WindowManagerNativeMethods.SC_MINIMIZE, 0);
}
else
{
int style = WindowManagerNativeMethods.GetWindowLong(id, WindowManagerNativeMethods.GWL_STYLE);
// If the window is not already minimized then minimize it
if ((style & WindowManagerNativeMethods.WS_MINIMIZE) != WindowManagerNativeMethods.WS_MINIMIZE)
{
WindowManagerNativeMethods.ShowWindowAsync(id, WindowManagerNativeMethods.SW_SHOWMINIMIZED);
}
}
this.RefreshThumbnails();
}
private void ThumbnailViewResized(IntPtr id)
{
if (this._ignoreViewEvents)