Kunda Posted December 25, 2015 Share Posted December 25, 2015 (edited) I found a solution to provide Desktop-TV without having to use the old overlay mixer which is no longer supported in newer Windows versions.It's basically a Autohotkey script which I compiled to an executable file DesktopTV-Win10.exe. Its currently only tested to work with Windows 10 and Windows 7 but may also work with other OS versions.Features: At the first start DesktopTV-Win10 creates an INI-file in which the settings are stored. It reads the current window position and dimensions from the DVBViewer settings.xml. If the language setting in DVBViewer is not "Deutsch" the tray menu and settings window will be displayed in english otherwise in german. At the first run DesktopTV-Win10 will start DVBViewer in fullscreen mode. If DVBViewer was already running it will be restarted to apply the necessary changes. The window is drawn as a child of the desktop so it will never be on top of another window. It's also "clickthrough-able" which means the context menu of the desktop will be shown when right-clicking the desktop. It's not possible to show desktop icons above the DVBViewer window. Therefore they must be temporarily hidden to avoid to unintentionally activate them. Your original setting for desktop items (Desktop context menu => display => show desktop icons) will be restored when DesktopTV-Win10 is closed. DesktopTV-Win10 provides an icon in the system tray with some context menu options: DVBViewer Forum: a direct link to this Forum thread Exit DVBViewer: DVBViewer and DesktopTV-Win10 will be closed Close DesktopTV-Win10: DVBViewer will be restarted in normal mode Settings: opens the Settings window In the settings window you can configure DesktopTV-Win10 by adjusting the following options: Fullscreen: shows DVBViewer in fullscreen mode when activated. Otherwise the Window settings are used. ClickThrough: the desktop context menu will be available when activated. Otherwise the DVBViewer context menu will be shown on right click. Hide Desktop Icons: Choose if you want to show or hide the desktop icons. If both options Fullscreen and ClickThrough are activated desktop icons will always be hidden. Window settings: these settings are used if the option Fullscreen was deactivated (all in Pixel): horizontal Position vertical Position Width Height Remarks: DesktopTV-Win10 makes the DVBViewer window a child of the desktop. If explorer.exe is closed/killed/restarted for any reason DVBViewer should therefore also be closed. Unfortunately this doesn't happen automatically so the application has to monitor explorer.exe and immediately close DVBViewer.exe if the PID of explorer.exe has changed. Otherwise DVBViewer.exe wouldn't work any longer and can't be closed in any way so you would have to restart your system to get it working again.This is the only reason why DesktopTV-Win10 has to run in the background as long as you're using the Desktop-TV mode. Update to version 1.2: The Ini-file is now saved in the configuration folder of DVBViewer to avoid write permission problems. Reading the window dimension values from settings.xml is now more reliable. The values are always read from the section "Display". If the values W and H are not available the values CW and CH are used. If UserMode=0 in usermode.ini the configuration folder is no longer considered to be in the installation folder of DVBViewer. You'll have to provide a full path with Root=[path] in usermode.ini in this case. Closing DVBViewer from tray menu or when explorer.exe was closed didn't work if DVBViewer was configured to ask for confirmation on exit. I changed all occurences of the actions.ini argument -x6 to -x12326 (Close DVBViewer without confirmation) to make this working. Some cosmetical changes for tray menu and settings dialog. Update to version 1.3: the exe file of Version 1.2 didn't work because a tray menu item couldn't be found when trying to apply an icon to it. The script worked because it doesn't apply icons to the tray menu items. Tray menuSettingsAutohotkey script DesktopTV-Win10.ahk #SingleInstance forceSendMode InputSetWorkingDir %A_ScriptDir%applicationname = DesktopTVversion = v1.2;Pfad zu DVBViewer.exe aus der Registrierung lesen;Read path to DVBViewer.exe from RegistryRegRead,DVBVPath,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\DVBViewer.exeSplitPath,DVBVPath,,InstallPath;DVBViewer Einstellungen (Sprache und Fensterdaten) aus setup.xml lesen;Read DVBViewer settings (Language and Window data) from setup.xmlIniRead,Mode,%InstallPath%\UserMode.ini,Mode,UserModeIniRead,Root,%InstallPath%\UserMode.ini,Mode,RootIf Mode=1DVBVSetup = %AppData%\%Root%If Mode=2DVBVSetup = %ProgramData%\%Root%If Mode=0DVBVSetup = %Root%FileRead,Text,%DVBVSetup%\setup.xmlRegExMatch(Text,"<entry name=""Language"">(.+)</entry>",Lang)Loop,Read,%DVBVSetup%\setup.xml{IfInString,A_LoopReadLine,<section name="Display">{Section = %A_Index%Break}}StringSplit, Text, Text, `n, `rLoop, %Text0%{ Line1 := Section + 1 Line2 := Section + 2 Line3 := Section + 3 Line4 := Section + 4 Line5 := Section + 5 Line6 := Section + 6 Line7 := Section + 7 Line8 := Section + 8 Line9 := Section + 9 Line10 := Section + 10 Line11 := Section + 11 Line12 := Section + 12 Line13 := Section + 13 Line14 := Section + 14 Line15 := Section + 15 Line16 := Section + 16 Line17 := Section + 17 Line18 := Section + 18 Line19 := Section + 19 Line20 := Section + 20}FileAppend,% Text%Line1% "`n" Text%Line2% "`n" Text%Line3% "`n" Text%Line4% "`n" Text%Line5% "`n" Text%Line6% "`n" Text%Line7% "`n" Text%Line8% "`n" Text%Line9% "`n" Text%Line10% "`n" Text%Line11% "`n" Text%Line12% "`n" Text%Line13% "`n" Text%Line14% "`n" Text%Line15% "`n" Text%Line16% "`n" Text%Line17% "`n" Text%Line18% "`n" Text%Line19% "`n" Text%Line20%,%temp%\Test.txtFileRead, xmldata,%temp%\Test.txtRegExMatch(xmldata,"<entry name=""X"">(.+)</entry>",Xdata)RegExMatch(xmldata,"<entry name=""Y"">(.+)</entry>",Ydata)RegExMatch(xmldata,"<entry name=""C?W"">(.+)</entry>",Wdata)RegExMatch(xmldata,"<entry name=""C?H"">(.+)</entry>",Hdata)FileDelete,%temp%\Test.txt;Sprachoptionen;Language optionsIf Lang1 = Deutsch{ExDVBV = DVBViewer &beendenExDTV = &Desktop TV beendenConfig = EinstellungenFull = VollbildClick = DurchklickbarIco = Desktop-Icons versteckenHor = horizontale Fensterposition:Vert = vertikale Fensterposition:WW = Fensterbreite:WH = Fensterhöhe:Use = AnwendenQuit = AbbrechenLink = http://www.DVBViewer.tv/forum/topic/57471-desktop-tv-autohotkey-script-windows-10/?p=438929}Else{ExDVBV = &Exit DVBViewerExDTV = Close &Desktop TVConfig = SettingsFull = FullscreenClick = ClickThroughIco = Hide Desktop IconsHor = horizontal Position:Vert = vertical Position:WW = WidthWH = HeightQuit = CancelUse = ReloadLink = http://www.DVBViewer.tv/forum/topic/57519-desktop-tv-without-overlay-mixer/}Gosub,READINIGosub,TRAYMENUOnExit, ExitSub;ursprüngliche Einstellung für Desktop-Icons speichern;Save current setting for desktop iconsControlGet,HWND,Hwnd,,SysListView321,ahk_class ProgmanIf HWND = ControlGet,HWND,Hwnd,,SysListView321,ahk_class WorkerWIf DllCall("IsWindowVisible",UInt,HWND) ShowIcons = True;Desktop-Icons verstecken, wenn die Option in den Einstellungen aktiviert wurde;Hide desktop icons if this option is activated in settingsIf HideDesktopIcons = True WinHide,ahk_id %HWND%;laufende DVBViewer-Instanz beenden, wenn vorhanden;Exit currently running instance of DVBViewer if presentProcess,Exist,DVBViewer.exeIf ErrorLevel <> 0{ Run,%DVBVPath% -x12326 Process,WaitClose,DVBViewer.exe};DVBViewer im Desktop-Modus starten;Start DVBViewer in desktop modeIf (%FullScreen% = True AND %ClickThrough% = True) WinHide,ahk_id %HWND%Run,%DVBVPath%WinWait,ahk_class TfrmMainIf ClickThrough = True WinSet, Transparent, 255, ahk_class TfrmMain WinSet,ExStyle,+0x80020, ahk_class TfrmMainIf FullScreen = True Run,%DVBVPath% -x5Else If FullScreen = False WinMove,ahk_class TfrmMain,,%X%,%Y%,%Width%,%Height%DllCall("SetParent",ptr,WinExist(),ptr,WinExist("Program Manager"));Wenn explorer.exe beendet wird DVBViewer ebenfalls beenden und Script neu starten;If explorer.exe was closed also close DVBViewer and restart this scriptProcess,Exist,explorer.exePID = %errorlevel%Loop{ Sleep, 200 Process,Exist,explorer.exe If errorlevel <> %PID% { Process,Close,DVBViewer.exe Process,WaitClose,DVBViewer.exe Process,Wait,explorer.exe Run, C:\Tools\AeroGlass\SetWindowCompositionAttribute.exe class Shell_TrayWnd accent 2 2 0 0,, Hide Run, C:\Tools\AeroGlass\SetWindowCompositionAttribute.exe class Shell_TrayWnd blur true,, Hide Process,Exist,explorer.exe PID = %errorlevel% Reload };Wenn DVBViewer beendet wird, dieses Script nach 3 Sekunden ebenfalls beenden;If DVBViewer was closed also close this script after 3 secondsProcess,Exist,DVBViewer.exeIf ErrorLevel = 0{ Sleep, 3000 ExitApp}}READINI:;INI-Datei erstellen;Create INI fileIfNotExist,%DVBVSetup%\%applicationname%.ini{inifile=;%applicationname%.iniinifile=%inifile%`ninifile=%inifile%`n[settings]inifile=%inifile%`nFullScreen=Trueinifile=%inifile%`nClickThrough=Trueinifile=%inifile%`nHideDesktopIcons=Trueinifile=%inifile%`nX=%Xdata1%inifile=%inifile%`nY=%Ydata1%inifile=%inifile%`nWidth=%Wdata1%inifile=%inifile%`nHeight=%Hdata1%FileAppend,%inifile%,%DVBVSetup%\%applicationname%.iniinifile=}IniRead,ClickThrough,%DVBVSetup%\%applicationname%.ini,Settings,ClickThroughIniRead,HideDesktopIcons,%DVBVSetup%\%applicationname%.ini,Settings,HideDesktopIconsIniRead,X,%DVBVSetup%\%applicationname%.ini,Settings,XIniRead,Y,%DVBVSetup%\%applicationname%.ini,Settings,YIniRead,Width,%DVBVSetup%\%applicationname%.ini,Settings,WidthIniRead,Height,%DVBVSetup%\%applicationname%.ini,Settings,HeightIniRead,FullScreen,%DVBVSetup%\%applicationname%.ini,Settings,FullScreenReturnTRAYMENU:Menu,Tray,NoStandardMenu,Tray,Tip,%applicationname% %version%Menu,Tray,Add,%applicationname% %version%,FEEDBACKMenu,Tray,AddMenu,Tray,Add,DVBViewer &Forum,FEEDBACKMenu,Tray,Add,%ExDVBV%,EXITDVBVMenu,Tray,Add,%ExDTV%,EXITDTVMenu,Tray,Add,&%Config%,SETTINGSIf A_IsCompiled = 1{Menu,Tray,Icon,%applicationname%,%A_ScriptName%Menu,Tray,Icon,DVBViewer &Forum,%A_ScriptName%,-206Menu,Tray,Icon,%ExDVBV%,%A_ScriptName%,-206Menu,Tray,Icon,%ExDTV%,%A_ScriptName%,-207Menu,Tray,Icon,&%Config%,%A_ScriptName%,-160}ReturnFEEDBACK:Run,%Link%ReturnSETTINGS:Gui,99:DestroyGui,99:Margin,10,10If A_IsCompiled = 1 Gui,99:Add,Picture,xm Icon1,%A_ScriptName%Gui,99:Font,BoldGui,99:Add,Text,x+10 yp+10,%applicationname% %version%If FullScreen=True Gui,99:Add,Checkbox,xm y80 checked vFS,%Full%Else If FullScreen=False Gui,99:Add,Checkbox,xm vFS,%Full%If ClickThrough=True Gui,99: Add,Checkbox,xm checked vCT,%Click%Else If ClickThrough=False Gui,99: Add,Checkbox,xm vCT,%Click%If HideDesktopIcons=True Gui,99:Add,Checkbox,xm checked vHDI,%Ico%Else If HideDesktopIcons=False Gui,99:Add,Checkbox,xm vHDI,%Ico%Gui,99:Font,BoldGui,99:Add,Text,xm y+20 Section,%Hor%Gui,99:Add,Text,xm y+20,%Vert%Gui,99:Add,Text,xm y+20,%WW%Gui,99:Add,Text,xm y+20,%WH%Gui,99:Add,Edit,ys w40 vnewX,%X%Gui,99:Add,Edit,w40 vnewY,%Y%Gui,99:Add,Edit,w40 vnewWidth,%Width%Gui,99:Add,Edit,w40 vnewHeight ,%Height%Gui,99:Add,Button,xm+30 Section Default gButtonOK,%Use%Gui,99:Add,Button,ys gButtonCancel, %Quit%Gui,99:+AlwaysOnTopGui,99:Show,,%Config%Return99GuiClose:Gui,99:DestroyReturnButtonOK:Gui,99:SubmitIf FS=1 IniWrite,True,%DVBVSetup%\%applicationname%.ini,Settings,FullscreenElse If FS=0 IniWrite,False,%DVBVSetup%\%applicationname%.ini,Settings,FullscreenIf CT=1 IniWrite,True,%DVBVSetup%\%applicationname%.ini,Settings,ClickThroughElse If CT=0 IniWrite,False,%DVBVSetup%\%applicationname%.ini,Settings,ClickThroughIf HDI=1 IniWrite,True,%DVBVSetup%\%applicationname%.ini,Settings,HideDesktopIconsElse If HDI=0 IniWrite,False,%DVBVSetup%\%applicationname%.ini,Settings,HideDesktopIconsIniWrite,%newX%,%DVBVSetup%\%applicationname%.ini,Settings,XIniWrite,%newY%,%DVBVSetup%\%applicationname%.ini,Settings,YIniWrite,%newWidth%,%DVBVSetup%\%applicationname%.ini,Settings,WidthIniWrite,%newHeight%,%DVBVSetup%\%applicationname%.ini,Settings,HeightReloadButtonCancel:Gui,99:DestroyReturnEXITDTV:Run,%DVBVPath% -x12326Process,WaitClose,DVBViewer.exeRun,%DVBVPath%ExitAppEXITDVBV:Run,%DVBVPath% -x12326ExitAppExitSub:If ShowIcons = True WinShow,ahk_id %HWND%ExitApp DesktopTV-Win10_v1.3.zip Edited January 16, 2016 by Kunda 1 Quote Link to comment
Kunda Posted January 8, 2016 Author Share Posted January 8, 2016 Update to version 1.2. For information about changes and download see first post. Please provide feedback here if the application is working/not working for you. Especially interesting would be if someone could get it working on the currently untested Windows versions XP, Vista, Win8 and Win8.1. Many thanks to Tjod who tested DesktopTV-Win10 and helped to fix some bugs. Quote Link to comment
SimonP Posted January 8, 2016 Share Posted January 8, 2016 Not something I need but a nice idea. Thanks for sharing it with us. Quote Link to comment
Residentcl Posted January 9, 2016 Share Posted January 9, 2016 Hi. a question: It is a stream mirroring? I'm still not sure that it serves the application. Quote Link to comment
Kunda Posted January 9, 2016 Author Share Posted January 9, 2016 Hi Residentcl, it's just a simple manipulation of the DVBViewer main window. It makes it a child window of the desktop so it's always at the bottom of all other windows and it makes it "click-through-able" so you'll get the context menu of the desktop when you right click theDVBViewer window. All this can basically be done with a very small Autohotkey script (ahk_class TfrmMain is the handle of the DVBViewer window): Desktopmode_Basics.ahk Run, C:\Program Files (x86)\DVBViewer\DVBViewer.exe ;Start DVBViewerWinWait, ahk_class TfrmMain ;Wait until the window is presentWinSet, Transparent, 255, ahk_class TfrmMain ;only needed for Win7 to get Click-Through workingWinSet, ExStyle, +0x80020, ahk_class TfrmMain ;make it Click-Through-ableDllCall("SetParent", ptr, WinExist() , ptr, WinExist("Program Manager")) ;make it a Desktop-Child Everything else in the script is to avoid problems if explorer.exe was closed (see Remarks in first post) and to make it easy to use and configure for everyone without having to fiddle around with Autohotkey scripts. The advantage in comparison with the old Desktop Mode feature of DVBViewer ist that it works without having to use the outdated Overlay Mixer renderer and that it's also working without fullscreen mode. You can pin the DVBViewer window on your desktop wherever you want and in every size you want. It will never come up on top of other windows. Quote Link to comment
Kunda Posted January 16, 2016 Author Share Posted January 16, 2016 Update to version 1.3:- the exe file of Version 1.2 didn't work because a tray menu item couldn't be found when trying to apply an icon to it. The script worked because it doesn't apply icons to the tray menu items. Please tell me if you try and it's not working for you. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.