public DPDesktopOverlay NewDPMonitorOverlay(UDDMonitor monitor) { int index = GetValidOverlayIndex(); if (DemoManager.isDemo) { if (DPDesktopOverlay.overlays.Count >= 3) { return(null); } } DPDesktopOverlay monitorDP = Instantiate(dpRenderWindowPF, _overlaysHolderTransform).GetComponentInChildren <DPDesktopOverlay>(); monitorDP.PreInitialize(); string key = "DPMonitor-" + index; monitorDP.dpAppParent.appKey = key; monitorDP.SetTargetCapture(monitor); monitorDP.dpAppParent.iconTex = desktopIcon; overlays.Add(monitorDP); TheBarManager.I.AddLoadedApp(monitorDP.dpAppParent); //OverlayInteractionManager.I.StartPreviewDrag(key); //TheBarManager.I.LaunchAppToMainSnap(key); //Debug.Log(monitorDP.overlay.handle + " : " + monitorDP.overlay.overlayKey + " : " + monitorDP.window.handle); return(monitorDP); }
/// <summary> /// Used internally for making a new overlay. /// </summary> /// <param name="window"></param> /// <returns>The created overlay</returns> public DPDesktopOverlay NewDPWindowOverlay(UwcWindow window) { if (window == null) { return(null); } int index = GetValidOverlayIndex(); if (DemoManager.isDemo) { if (DPDesktopOverlay.overlays.Count >= 3) { return(null); } } DPDesktopOverlay dpWindow = Instantiate(dpRenderWindowPF, _overlaysHolderTransform).GetComponentInChildren <DPDesktopOverlay>(); dpWindow.PreInitialize(); string key = "DPWindow-" + index; dpWindow.dpAppParent.appKey = key; //dpWindow.InitWindow(window); if (WinNative.IsIconic(window.handle)) { WinNative.ShowWindow(window.handle, ShowWindowCommands.Restore); } //WinNative.SetForegroundWindow(window.handle); dpWindow.SetTargetCapture(window); dpWindow.dpAppParent.iconTex = window.iconTexture; overlays.Add(dpWindow); TheBarManager.I.AddLoadedApp(dpWindow.dpAppParent); //OverlayInteractionManager.I.StartPreviewDrag(key); //TheBarManager.I.LaunchAppToMainSnap(key); Debug.Log(dpWindow.overlay.handle + " : " + dpWindow.overlay.overlayKey + " : " + dpWindow.window.handle); return(dpWindow); }