I want all the close buttons ro remain greyed out ur just not there when I run netflix and nother software on my windows 10 media-server.... I have a seven year old daughter who always wakes me up several times to ask all this questions about why it closed down etc etc every morning.
Now I just have a problem.... I use the netflix app that you download from microsoft store and I cant find any solution on how I can launch it from AutoIt.... My code like this currebtly:
; Original script: http://www.autoitscript.com/forum/topic/100125-disable-close-button/#entry716490
; USer32.dll functions: http://msdn.microsoft.com/en-us/library/ms647985(v=vs.85).aspx
#include <GuiMenu.au3>
Run(netflix', @SW_MAXIMIZE) ------> This part I left as it is since my last test... I'd rather let you try and dig into it if you can find an opyion.
WinWait("Netflix")
$handle = WinGetHandle("Netflix")
ConsoleWrite('+ Window Handle: ' & $handle & @CRLF)
DisableButton($handle, $SC_CLOSE)
;~ EnableButton($handle, $SC_CLOSE)
DisableButton($handle, $SC_RESTORE)
DisableButton($handle, $SC_MOVE)
DisableButton($handle, $SC_SIZE)
DisableButton($handle, $SC_MAXIMIZE)
DisableButton($handle, $SC_MINIMIZE)
Func DisableButton($hWnd, $iButton)
$hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 0)
_GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False)
_GUICtrlMenu_DrawMenuBar($hWnd)
EndFunc
Func EnableButton($hWnd, $iButton)
$hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 1)
_GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False)
_GUICtrlMenu_DrawMenuBar($hWnd)
EndFunc
Thank Netjer for you guys!
//Vrilya