Jump to content

How can I run a Windows 10 App in AutoIT (Netflix in this case)


Recommended Posts

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

Link to comment
Share on other sites

6 hours ago, VIP said:

Try: 

#RequireAdmin
ShellExecute("netflix://", Null, Null, "open")

I have removed Windows 10, I can not try it.

Hi, And thank yiu.... it successfully launched the App the only problem I had was that it did'nt have any effect on such things close, minimize, maximize, etc.
The command I use 

DisableButton($handle, $SC_MAXIMIZE)

for example dont work in this instance.... do you or possibly someone else have any idea why? :)

May Netjer be with you!
Vrilya

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...