internal CustomWindowsManager(ProxyWindow proxy, IntPtr hwndParent) { _hwnd = proxy.RealWindow; _hwndParent = hwndParent; _proxyWindow = proxy;//Just keep it alive _proxyWindow.WindowsManager = this; Windows7Taskbar.EnableCustomWindowPreview(WindowToTellDwmAbout); }
/// <summary> /// Enables custom window preview on this form, meaning that /// the DWM will send messages when a live thumbnail preview /// or a live peek will be necessary. /// </summary> /// <param name="form">The form.</param> public static void EnableCustomWindowPreview(this Form form) { Windows7Taskbar.EnableCustomWindowPreview(form.Handle); }
/// <summary> /// Enables custom window preview on this Window, meaning that /// the DWM will send messages when a live thumbnail preview /// or a live peek will be necessary. /// </summary> /// <param name="form">The form.</param> public static void EnableCustomWindowPreview(this Window form) { Windows7Taskbar.EnableCustomWindowPreview(GetWindowHandle(form)); }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { playback = mcRef.GetPlayback(); //customWindow = Windows7.DesktopIntegration.CustomWindowsManager.CreateWindowsManager((IntPtr)mcRef.GetWindowHandle(), IntPtr.Zero); //IMJFileAutomation nowPlayingFile; //nowPlayingFile = mcRef.GetCurPlaylist().GetFile(mcRef.GetCurPlaylist().Position); int i = 0; string prevFile = ""; string currentFile = ""; while (playback.State != MJPlaybackStates.PLAYSTATE_STOPPED) { nowPlayingFile = mcRef.GetCurPlaylist().GetFile(mcRef.GetCurPlaylist().Position); setWindowsPeak(); if (enableCoverArt.Checked) { Windows7Taskbar.EnableCustomWindowPreview((IntPtr)mcRef.GetWindowHandle()); currentFile = nowPlayingFile.GetImageFile(MJImageFileFlags.IMAGEFILE_THUMBNAIL_MEDIUM); if (!string.IsNullOrEmpty(currentFile)) { if (currentFile != prevFile) { setPreview(currentFile); } } else { Windows7Taskbar.DisableCustomWindowPreview((IntPtr)mcRef.GetWindowHandle()); } prevFile = currentFile; } else { Windows7Taskbar.DisableCustomWindowPreview((IntPtr)mcRef.GetWindowHandle()); } createThumbnail(getDisplayWindowHandle()); if (trackProgress.Checked) { if (playback.State == MJPlaybackStates.PLAYSTATE_PLAYING) { windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal); addUserInfoText("Duration: " + playback.Duration); if (nowPlayingFile.Duration <= 0) { windowsTaskbar.SetProgressState(TaskbarProgressBarState.Indeterminate); } else { if (playback.Position >= 0) { windowsTaskbar.SetProgressValue(playback.Position, nowPlayingFile.Duration); } } } else if (playback.State == MJPlaybackStates.PLAYSTATE_PAUSED) { windowsTaskbar.SetProgressState(TaskbarProgressBarState.Paused); } } else if (playlistProgress.Checked) { windowsTaskbar.SetProgressState(playback.State != MJPlaybackStates.PLAYSTATE_PAUSED ? TaskbarProgressBarState.Normal : TaskbarProgressBarState.Paused); windowsTaskbar.SetProgressValue(mcRef.GetCurPlaylist().Position, mcRef.GetCurPlaylist().GetNumberFiles()); } else { windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress); } setWindowTitle(); System.Threading.Thread.Sleep(500); GC.Collect(); i++; } //Windows7Taskbar.DisableCustomWindowPreview((IntPtr)mcRef.GetWindowHandle()); windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress); return; }
public void EnablePreview() { Windows7Taskbar.EnableCustomWindowPreview(WindowToTellDwmAbout); }
internal CustomWindowsManager(IntPtr hwnd) { _hwnd = hwnd; Windows7Taskbar.EnableCustomWindowPreview(hwnd); }