// Specifically for the video in chat windows. void Lync2013_IMWindow_Selection(object sender, WindowSelectionEventArgs e) { if (e.IsSelectionMade) { return; } var info = e.ActiveWindow; if (e.Process.ProcessName == Lync2013_IMWindow_Process && info.WindowClass == Lync2013_IMWindow_IMWindow) { // Get the last CtrlNotifySink that contains a LCC_VideoParent. //var sink = info.ChildWindows.First( // x => x.WindowClass == Lync2013_IMWindow_CtrlNotifySink && // x.ChildWindows.Any(y => y.WindowClass == Lync2013_IMWindow_VideoParent)); //TODO: Hm, looks like Lync 2013 does everything owner-draw so none of the child windows has any size or dimension? //TODO: What do we do when Lync is marked as "always on top?" var sink = info.ChildWindows.First(x => x.WindowClass == "NetUIHWND"); // Check if we got a result. if (sink == null) { return; } // Check that the CtrlNotifySink is visible. if (sink.Style.HasFlag(WindowMonitor.WindowStyles.Visible)) { // Select the video area so that we get the overlay // appearing there. e.Select(sink); } } }
// Specifically for the video in chat windows. void Lync2010_IMWindow_Selection(object sender, WindowSelectionEventArgs e) { if (e.IsSelectionMade) { return; } var info = e.ActiveWindow; if (e.Process.ProcessName == Lync2010_IMWindow_Process && info.WindowClass == Lync2010_IMWindow_IMWindow) { // Get the last CtrlNotifySink that contains a LCC_VideoParent. var sink = info.ChildWindows.Last( x => x.WindowClass == Lync2010_IMWindow_CtrlNotifySink && x.ChildWindows.Any(y => y.WindowClass == Lync2010_IMWindow_VideoParent)); // Check if we got a result. if (sink == null) { return; } // Check that the CtrlNotifySink is visible. if (sink.Style.HasFlag(WindowMonitor.WindowStyles.Visible)) { // Select the video area so that we get the overlay // appearing there. e.Select(sink); } } }
// Specifically for the video in chat windows. void Lync2013_IMWindow_Selection(object sender, WindowSelectionEventArgs e) { if (e.IsSelectionMade) return; var info = e.ActiveWindow; if (e.Process.ProcessName == Lync2013_IMWindow_Process && info.WindowClass == Lync2013_IMWindow_IMWindow) { // Get the last CtrlNotifySink that contains a LCC_VideoParent. //var sink = info.ChildWindows.First( // x => x.WindowClass == Lync2013_IMWindow_CtrlNotifySink && // x.ChildWindows.Any(y => y.WindowClass == Lync2013_IMWindow_VideoParent)); //TODO: Hm, looks like Lync 2013 does everything owner-draw so none of the child windows has any size or dimension? //TODO: What do we do when Lync is marked as "always on top?" var sink = info.ChildWindows.First(x => x.WindowClass == "NetUIHWND"); // Check if we got a result. if (sink == null) return; // Check that the CtrlNotifySink is visible. if (sink.Style.HasFlag(WindowMonitor.WindowStyles.Visible)) { // Select the video area so that we get the overlay // appearing there. e.Select(sink); } } }
// Specifically for the video in chat windows. void Lync2010_IMWindow_Selection(object sender, WindowSelectionEventArgs e) { if (e.IsSelectionMade) return; var info = e.ActiveWindow; if (e.Process.ProcessName == Lync2010_IMWindow_Process && info.WindowClass == Lync2010_IMWindow_IMWindow) { // Get the last CtrlNotifySink that contains a LCC_VideoParent. var sink = info.ChildWindows.Last( x => x.WindowClass == Lync2010_IMWindow_CtrlNotifySink && x.ChildWindows.Any(y => y.WindowClass == Lync2010_IMWindow_VideoParent)); // Check if we got a result. if (sink == null) return; // Check that the CtrlNotifySink is visible. if (sink.Style.HasFlag(WindowMonitor.WindowStyles.Visible)) { // Select the video area so that we get the overlay // appearing there. e.Select(sink); } } }