Windows 8 - Netflix App or WMC plug-in? - Page 5 - AVS | Home Theater Discussions And Reviews
Baselworld is only a few weeks away. Getting the latest news is easy, Click Here for info on how to join the Watchuseek.com newsletter list. Follow our team for updates featuring event coverage, new product unveilings, watch industry news & more!


Forum Jump: 
 3Likes
Reply
 
Thread Tools
post #121 of 125 Old 02-20-2015, 05:59 PM
Advanced Member
 
jmone's Avatar
 
Join Date: May 2007
Posts: 509
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Liked: 34
Hi mholdate,
Thanks for the script! I've been modding it to work with JRiver Media Center and have posted the details at Another Way To Watch Netflix With a 10 Foot Interface & RC (Win8/10 only).

To your script I've added:
- start and stop the Netflix App
- ability to change refresh rates
- Play/Pause key now works
- Stop will terminate the script and return to the app that launched it (MC)

Edit - I've not (yet) played with your navigation sections but for me I'mm prob remap some of the keys.

Thanks
Nathan

Here is the code and I've marked the section of my changes:
Code:
Original Script and Author at https://gist.github.com/holgate/01d73c6ac33ab4b6d66f
;Modified by jmone for JRiver Media Center use http://yabb.jriver.com/interact/index.php?topic=95627.0
;
;DEFINE CONSTANTS...
;
;
; Global value settings that are independant to display-size...
;
; MAIN MENU
boundaryLeft := 120
boundaryRight := 1800
leftScrollbarXpos := 28
leftScrollbarYpos := 1065
rightScrollbarXpos := 1891
rightScrollbarYpos := 1065
;
; For 1920x1080px displays, with "Change the Size of Apps on the screen" set to "Default"...
;
; MAIN MENU
mainmenuHeaderTop := 140  ;top categories text start Y pos
mainmenuGridTop := 182  ;top thumbs start Y pos
mainmenuStartXpos := 800  ; init X position
mainmenuStartYpos := 350  ; init Y position
mainmenuThumbDisplacementX := 141
mainmenuThumbDisplacementY := 196
; SEARCH MENU
searchButtonXpos := 1718
searchButtonYpos := 70
; SEARCH RESULTS
searchresultsStartXpos := 560  ; init X position
searchresultsStartYpos := 265  ; init Y position
; NAV MENU
navmenuButtonXpos := 1646
navmenuButtonYpos := 69
navmenuFirstMenuButtonXpos := 156
navmenuFirstMenuButtonYpos := 63
navmenuThumbDisplacementX := 267
navmenuThumbDisplacementY := 44
; CATEGORIES MENU
categoriesButtonXpos := 1900
categoriesButtonYpos := 1047
categoriesFirstMenuButtonXpos := 174
categoriesFirstMenuButtonYpos := 304
categoriesThumbDisplacementX := 195
categoriesThumbDisplacementY := 265
; DETAILS PAGE
backnavXpos := 38  ; top back nav button X pos
backnavYpos := 68  ; top back nav button Y pos
seasonButtonXpos := 228
seasonButtonYpos := 368
seasonButtonRowHeight := 46
detailsHeaderTop := 368  ;top season selector button start Y pos
detailsGridTop := 416  ;top thumbs start Y pos
detailsStartXpos := 268  ; init X position
detailsStartYpos := 518  ; init Y position
detailsThumbDisplacementX := 381
detailsThumbDisplacementY := 0
; PLAYING MEDIA
;   SKIP/NAV CONTROLS
skipnextXpos := 330
skipnextYpos := 100
skipprevXpos := 167
skipprevYpos := 100
;   TIMELINE BAR
timelinebar0Xpos := 114
timelinebar0Ypos := 944
timelinebar100Xpos := 1764
timelinebar100Ypos := 944
timelinebar10Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*1) + timelinebar0Xpos
timelinebar20Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*2) + timelinebar0Xpos
timelinebar30Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*3) + timelinebar0Xpos
timelinebar40Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*4) + timelinebar0Xpos
timelinebar50Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*5) + timelinebar0Xpos
timelinebar60Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*6) + timelinebar0Xpos
timelinebar70Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*7) + timelinebar0Xpos
timelinebar80Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*8) + timelinebar0Xpos
timelinebar90Xpos := ((timelinebar100Xpos - timelinebar0Xpos) /10*9) + timelinebar0Xpos
timelinebarColorHandle := "0x0A07B2"
timelinebarColorBg := "0x3F3F3F"
;   FOOTER CONTROLS
nextepisodeXpos := 1656
nextepisodeYpos := 1024
episodesmenuXpos := 1760
episodesmenuYpos := 1024
languagesmenuXpos := 1856
languagesmenuYpos := 1024
;
;DEFINE VARIABLES...
currentView := "mainmenu"  ;can be: mainmenu, mainmenu_category, details, details_seasonSelector, movie, search, searchresults, navmenu, categoryGrid
gridTop := mainmenuGridTop
;
CoordMode, Mouse, Screen  ;Mouse coords used from here on will be absolute to the screen coordinates, not relative to the active window
#SingleInstance force ;Only one instance of script can run
#Persistent ;Make this script run indefinitely
#NoEnv
;#InstallKeybdHook 
SetTitleMatchMode 3
SetDefaultMouseSpeed, 0 ;Move the mouse instantly.
;
;checkNetflixExists:


;=======================
;--Changes by jmone-----
;=======================
; Process, Close, netflix.exe
run, explorer.exe netflix:
sleep, 1000
Loop
{
  Process, Exist, netflix.exe
  IF !errorlevel=0
    {
     run, explorer.exe netflix:
     WinActivate, Netflix
     WinMaximize, Netflix
     sleep, 1000
     Break
    }
  Else
  {
    run, explorer.exe netflix:
    sleep, 1000
    If a_index > 10
    {	Msgbox Netflix is not able to load
	ExitApp
    }
  }
}
#ifWinActive, Netflix
Click 1840,10 ; toggle full screen mode in Win10
MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0  ;Move the mouse to init location

Loop
{
;startMonitoring:

  Gui +LastFound
  hWnd := WinExist()
  DllCall( "RegisterShellHookWindow", UInt,hWnd )
  MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
  OnMessage( MsgNum, "ShellMessage" )
  Return
  
ShellMessage( wParam,lParam ) {
;   tooltip,% wParam "-" lParam>>16
   If ( wParam = 12 ) ;  HSHELL_APPCOMMAND := 12
      {
      HiWord:=lParam>>16
      IfEqual,HiWord,4142,SendRaw {Space}; Play
      IfEqual,HiWord,4143,SendRaw {Space}; Pause
;      IfEqual,HiWord,4145,Msgbox >>
;      IfEqual,HiWord,4146,Msgbox <<
;      IfEqual,HiWord,1,Msgbox Exit
      }      
    }
;
  Media_Stop::  ; This is the STOP button (Media_Stop) - you can change to suit your requirements
  WinClose
  Process, Close, netflix.exe
  cD = 32   ; bits (quality) - you can change to suit your requirments 
  sW = 1920 ; pixels - you can change to suit your requirments 
  sH = 1080  ; pixels - you can change to suit your requirments 
  rR = 50   ; Hz (frequency) - you can change to suit your requirments 
  ChangeDisplaySettings( cD, sW, sH, rR ) 
;  Run "C:\Program Files (x86)\J River\Media Center 20\Media Center 20.exe"
  ExitApp
  return

  0::Click 1840,10 ; toggle full screen mode in Win10
  MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0  ;Move the mouse to init location
  return
;
  2:: ; If the "2" button is pressed change refresh rate to 23 or 24hz
  cD = 32   ; bits (quality) - you can change to suit your requirments 
  sW = 1920 ; pixels - you can change to suit your requirments 
  sH = 1080  ; pixels - you can change to suit your requirments 
  rR = 23   ; Hz (frequency) - you can change to suit your requirments 
  ChangeDisplaySettings( cD, sW, sH, rR ) 
  return
;
  5:: ; If the "5" button is pressed change refresh rate to 50hz
  cD = 32   ; bits (quality) - you can change to suit your requirments 
  sW = 1920 ; pixels - you can change to suit your requirments 
  sH = 1080  ; pixels - you can change to suit your requirments 
  rR = 50   ; Hz (frequency) - you can change to suit your requirments 
  ChangeDisplaySettings( cD, sW, sH, rR ) 
  return
;
  6:: ; If the "6" button is pressed change refresh rate to 60hz
  cD = 32   ; bits (quality) - you can change to suit your requirments 
  sW = 1920 ; pixels - you can change to suit your requirments 
  sH = 1080  ; pixels - you can change to suit your requirments 
  rR = 60   ; Hz (frequency) - you can change to suit your requirments 
  ChangeDisplaySettings( cD, sW, sH, rR ) 
  return
; --------------------------------------------------------
; The script that makes the DLL Call to change the resolution - Don't Change
; --------------------------------------------------------
ChangeDisplaySettings( cD, sW, sH, rR ) { 
  VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36) 
  DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40) 
  NumPut(cD,dM,104),  NumPut(sW,dM,108),  NumPut(sH,dM,112),  NumPut(rR,dM,120) 
  Return DllCall( "ChangeDisplaySettings", UInt,&dM, UInt,0 ) 
}  

;=================================
;--End of Changes by jmone-----
;=================================

  Down::
    if (currentView = "details")
    {
      ;MouseMove, 0,%detailsThumbDisplacementY%, 0, R
      MouseMove, 0,%mainmenuThumbDisplacementY%, 0, R  ;TODO
    } else if (currentView = "details_seasonSelector") {
      MouseMove, 0,%seasonButtonRowHeight%, 0, R
    } else if (currentView = "navmenu") {
      MouseMove, 0,%navmenuThumbDisplacementY%, 0, R
    } else if (currentView = "categoryGrid") {
      MouseMove, 0,%categoriesThumbDisplacementY%, 0, R
    } else {
      MouseMove, 0,%mainmenuThumbDisplacementY%, 0, R
    }
    Goto, checkBounds
    return

  Up::
    if (currentView = "details")
    {
      ;MouseMove, 0,-%detailsThumbDisplacementY%, 0, R
      MouseMove, 0,-%mainmenuThumbDisplacementY%, 0, R  ;TODO
    } else if (currentView = "details_seasonSelector") {
      MouseMove, 0,-%seasonButtonRowHeight%, 0, R
    } else if (currentView = "navmenu") {
      MouseMove, 0,-%navmenuThumbDisplacementY%, 0, R
    } else if (currentView = "categoryGrid") {
      MouseMove, 0,-%categoriesThumbDisplacementY%, 0, R
    } else {
      MouseMove, 0,-%mainmenuThumbDisplacementY%, 0, R
    }
    Goto, checkBounds
    return

  Right::
    ; Move the mouse by X pixels Right from its current location:
    ;MouseMove, %mainmenuThumbDisplacementX%,0, 0, R
    MouseGetPos, mouseXpos, mouseYpos
    if (currentView = "details")
    {
      MouseMove, %detailsThumbDisplacementX%, 0, 0, R
    } else if (currentView = "details_seasonSelector") {
      
    } else if (currentView = "navmenu") {
      MouseMove, %navmenuThumbDisplacementX%, 0, 0, R
    } else if (currentView = "categoryGrid") {
      MouseMove, %categoriesThumbDisplacementX%, 0, 0, R
    } else {
      MouseMove, %mainmenuThumbDisplacementX%, 0, 0, R
    }
    Goto, checkBounds
    return

  Left::
    ; Move the mouse by X pixels Left from its current location:
    ;MouseMove, -%mainmenuThumbDisplacementX%,0, 0, R
    MouseGetPos, mouseXpos, mouseYpos
    if (currentView = "details")
    {
      MouseMove, -%detailsThumbDisplacementX%, 0, 0, R
    } else if (currentView = "details_seasonSelector") {
      
    } else if (currentView = "navmenu") {
      MouseMove, -%navmenuThumbDisplacementX%, 0, 0, R
    } else if (currentView = "categoryGrid") {
      MouseMove, -%categoriesThumbDisplacementX%, 0, 0, R
    } else {
      MouseMove, -%mainmenuThumbDisplacementX%, 0, 0, R
    }
    Goto, checkBounds
    return


  F9::
  ; Reset init pos
  MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0
  return


  ENTER::
  ; Select
  ;currentView := "details" 
  ;MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0
  MouseGetPos, savedXpos, savedYpos  ;save position of currently selected menu item
  Click
  if (currentView="details" and savedXpos=seasonButtonXpos and savedYpos=seasonButtonYpos)
  {
    currentView := "details_seasonSelector"
    ;MsgBox, currentView    
  } else if (currentView="details_seasonSelector") {
    currentView := "details"
    MouseMove, %detailsStartXpos%, %detailsStartYpos%, 0
  } else if (currentView="details") {
    savedDetailsXpos := savedXpos  ;save position of currently selected menu item
    savedDetailsYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100 
    currentView := "movie"
  } else if (currentView="mainmenu" and savedYpos<mainmenuGridTop) {  ;i.e. if user selected a category at top of manimenu grid
    savedMainmenuXpos := savedXpos  ;save position of currently selected menu item
    savedMainmenuYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100 
    currentView := "mainmenu_category"
    MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0
  } else if (currentView="navmenu") {
    savedNavmenuXpos := savedXpos  ;save position of currently selected menu item
    savedNavmenuYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100 
    currentView := "mainmenu_category"
    MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0
  } else if (currentView="categoryGrid") {
    savedCategoryXpos := savedXpos  ;save position of currently selected menu item
    savedCategoryYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100 
    currentView := "mainmenu"
    MouseMove, %mainmenuStartXpos%, %mainmenuStartYpos%, 0
  } else if (currentView="searchresults") {
    savedSearchresultsXpos := savedXpos  ;save position of currently selected menu item
    savedSearchresultsYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100 
    currentView := "details"
    MouseMove, %detailsStartXpos%, %detailsStartYpos%, 0
  } else {  ;i.e. if in "mainmenu" view...
    savedMainmenuXpos := savedXpos  ;save position of currently selected menu item
    savedMainmenuYpos := savedYpos  ;save position of currently selected menu item
    Sleep, 100      
    currentView := "details" 
    MouseMove, %detailsStartXpos%, %detailsStartYpos%, 0
  }
  return

  ;Media_Prev
  !#P::  ;  !=Alt; #=Windowskey; ^=Ctrl; +=Shift
  KeyWait, P, T0.5  ;wait for Xseconds ;NOTE: "KeyWait, Media_Prev, T1" doesnt work because it's a Media button and not a physical/logical button apparently, hence why I remapped this button!?!
  If ErrorLevel = 0
  {
    ;SHORT PRESS
    lastKeyPressed := "skipPrev" 
    Goto, GetProgress 
    return
  }
  Else
  {
    ;LONG PRESS
    ;go to timecode 0:00
    MouseGetPos, MouseX, MouseY  
    MouseMove, MouseX+1, MouseY+1, 0  ;move the mouse to make the progess bar appear
    ;Click right  ;click right mouse button to make the progess bar appear
    Sleep, 500  ;wait for UI to react/update
    jumpPos := timelinebar0Xpos
    Goto, jumpToTimelinePos
  }
  return

  Media_Next::
  lastKeyPressed := "skipNext"
  Goto, GetProgress
  return

  GetProgress:
  MouseGetPos, MouseX, MouseY  
  MouseMove, MouseX+1, MouseY+1, 0  ;move the mouse to make the progess bar appear
  ;Click right  ;click right mouse button to make the progess bar appear
  Sleep, 500  ;wait for UI to react/update
  PixelGetColor, barColor, timelinebar10Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 0
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar0Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar10Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar20Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 10
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar0Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar20Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar30Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 20
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar10Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar30Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar40Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 30
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar20Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar40Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar50Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 40
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar30Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar50Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar60Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 50
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar40Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar60Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar70Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 60
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar50Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar70Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar80Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 70
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar60Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar80Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar90Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 80
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar70Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar90Xpos
    }
    Goto, jumpToTimelinePos
    return
  }
  PixelGetColor, barColor, timelinebar100Xpos, timelinebar0Ypos
  if (barColor = timelinebarColorBg) {
    barProgress := 90
    if (lastKeyPressed = "skipPrev") {
      jumpPos := timelinebar80Xpos
    } else if (lastKeyPressed = "skipNext") {
      jumpPos := timelinebar100Xpos - 80  ;minus credits buffer
    }
    Goto, jumpToTimelinePos
    return
  }
  return

  jumpToTimelinePos:  
  ;MsgBox progress bar is at %barProgress%
  Click %jumpPos%, %timelinebar0Ypos%
  return

  !#I::  ;  !=Alt; #=Windowskey; ^=Ctrl; +=Shift
  ; Info button
  ;Sleep, 100
  Click %episodesmenuXpos%, %episodesmenuYpos%
  return

  Browser_Back::
  ; Back
  if (currentView = "details_seasonSelector")
  {
    Send {Escape}  ;to exit out of navMenu
    currentView := "details"
  } else if (currentView = "movie") {
    Click %backnavXpos%, %backnavYpos%
    Send {Escape}  ;to exit out of navMenu
    Sleep, 100
    MouseMove, savedDetailsXpos,savedDetailsYpos, 0
    currentView := "details"
  } else if (currentView = "searchresults") {
    Click %backnavXpos%, %backnavYpos%
    Send {Escape}  ;to exit out of navMenu
    Sleep, 100
    MouseMove, savedMainmenuXpos,savedMainmenuYpos, 0
    currentView := "mainmenu"
  } else {  ;i.e. if in "details" view, or a sub-category view in the mainmenu...
    Click %backnavXpos%, %backnavYpos%
    Send {Escape}  ;to exit out of navMenu
    Sleep, 100
    MouseMove, savedMainmenuXpos,savedMainmenuYpos, 0
    currentView := "mainmenu"
  }
  return

  !#G::  ;  !=Alt; #=Windowskey; ^=Ctrl; +=Shift
  ;MsgBox backPRessed
  ; Search
  Click %searchButtonXpos%, %searchButtonYpos%
  Sleep, 100
  MouseMove, searchresultsStartXpos, searchresultsStartYpos, 0
  currentView := "searchresults"
  return

  !#R::  ;  !=Alt; #=Windowskey; ^=Ctrl; +=Shift
  ; navmenu (accessed via Hamburger icon)
  MouseGetPos, savedMainmenuXpos, savedMainmenuYpos  ;save position of currently selected menu item
  Click %navmenuButtonXpos%, %navmenuButtonYpos%
  Sleep, 100
  MouseMove, navmenuFirstMenuButtonXpos,navmenuFirstMenuButtonYpos, 0
  currentView := "navmenu"
  return

  !#Y::  ;  !=Alt; #=Windowskey; ^=Ctrl; +=Shift
  ; categoryGrid (accessed via '-' icon in bottom right)
  MouseGetPos, savedMainmenuXpos, savedMainmenuYpos  ;save position of currently selected menu item
  Click %categoriesButtonXpos%, %categoriesButtonYpos%
  Sleep, 100
  MouseMove, categoriesFirstMenuButtonXpos,categoriesFirstMenuButtonYpos, 0
  currentView := "categoryGrid"
  return


  checkBounds:
  MouseGetPos, mouseXpos, mouseYpos
  ;MsgBox, %currentView%
  if (currentView = "details") {
    ;MsgBox, itsOnDetails
    ;gridTop = %detailsGridTop%
    if (mouseYpos < detailsGridTop) {
      MouseMove, %seasonButtonXpos%, %seasonButtonYpos%, 0
      return
    }
    if (mouseXpos < boundaryLeft) {
      ;SendRaw {Left}
        ;MouseGetPos, mouseXpos, mouseYpos
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        ;MouseMove, %mouseXpos%, %mouseYpos%, 0  ;move it back to where it was
      MouseMove, %boundaryLeft%, %mouseYpos%, 0  ;temp
      ;Send {PgUp}
      return
    } else if (mouseXpos > boundaryRight) {
      ;SendInput {Right}
        ;MouseGetPos, mouseXpos, mouseYpos
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        ;MouseMove, %mouseXpos%, %mouseYpos%, 0  ;move it back to where it was
      MouseMove, %boundaryRight%, %mouseYpos%, 0  ;temp
      ;Send {PgDn}
      return
    }    
  } else if (currentView = "navmenu") {
    
  } else {
    ;MsgBox, %currentView%    
    ;gridTop = %mainmenuGridTop%
    if (mouseYpos < mainmenuHeaderTop) {
      MouseMove, %mouseXpos%, %mainmenuHeaderTop%, 0
      return
    }
    if (mouseXpos < boundaryLeft) {
      ;SendRaw {Left}
      MouseMove, %boundaryLeft%, %mouseYpos%, 0  ;temp
      if (currentView = "mainmenu_category") {
        ;Send {PgUp}
        MouseGetPos, mouseXpos, mouseYpos
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        Click %leftScrollbarXpos%, %leftScrollbarYpos%
        MouseMove, %mouseXpos%, %mouseYpos%, 0  ;move it back to where it was
      } else {
        Click WheelLeft
      }
      return
    } else if (mouseXpos > boundaryRight) {
      ;SendInput {Right}
      MouseMove, %boundaryRight%, %mouseYpos%, 0  ;temp
      if (currentView = "mainmenu_category") {
        ;Send {PgDn}
        MouseGetPos, mouseXpos, mouseYpos
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        Click %rightScrollbarXpos%, %rightScrollbarYpos%
        MouseMove, %mouseXpos%, %mouseYpos%, 0  ;move it back to where it was
      } else {
        Click WheelRight
      }
      return
    }
  }
  return  
}
return

Last edited by jmone; 02-20-2015 at 07:44 PM.
jmone is offline  
Sponsored Links
Advertisement
 
post #122 of 125 Old 02-25-2015, 11:33 PM
Newbie
 
Join Date: Feb 2015
Posts: 7
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 0
I still use windows 7, how do you feel about windows 8?
micagordon is offline  
post #123 of 125 Old 02-26-2015, 10:25 PM
Member
 
mholgate's Avatar
 
Join Date: Jun 2003
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 6 Post(s)
Liked: 13
Nice job jmone!
mholgate is offline  
post #124 of 125 Old 02-28-2015, 07:00 PM
Advanced Member
 
jmone's Avatar
 
Join Date: May 2007
Posts: 509
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Liked: 34
No Probs and thanks for the original script. Any clues on how to best manage Metro Apps as from AHK. Cross post from the AHK forum but no response:

Quote:
I'm finding it hard to do many things with Windows 8 Metro Apps and wonder what others have found (example Netflix App):
- RUN : The best I've found is "run, explorer.exe netflix:" but this is not always consistent with sometime the app starting as a background process. It would be great to be able to target the runtime directly somehow
- PROCESS: Works fine "process, Exist, netflix.exe" etc
- WinActivate / WinExist / WinMaxize etc : These don't seem to work as the windows does not have a name (according to WindowSpy it exists for a very short period and once it has run full screen there it is not visible). Any clue on how to workout if a Metro app is running full screen and is the top app?
Also if we could determine the fps of the stream we could auto switch the TV to the correct setting

Thanks
Nathan
jmone is offline  
post #125 of 125 Old 03-06-2015, 01:59 PM
Member
 
mholgate's Avatar
 
Join Date: Jun 2003
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 6 Post(s)
Liked: 13
Quote:
Originally Posted by jmone View Post
No Probs and thanks for the original script. Any clues on how to best manage Metro Apps as from AHK...
I just start the Netflix app from a .cmd (batch) file containing:
Code:
@echo off
"%programfiles(x86)%\cmdutils\min.exe"
start netflix://
The min.exe command minimises the batch file instantly so there's no 'flicker' of the command line window. You can get cmdutils from: paulsadowski dot com
mholgate is offline  
Sponsored Links
Advertisement
 
Reply Home Theater Computers

Tags
Logitech



Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off