djvj icon

BlueStacks Module

djvj | PRO | 01/08/17 09:29:12 PM UTC | 0 ⭐ | 706 👁️ | Never ⏰ | []
text |

4.17 KB

|

None

|

0 👍

/

0 👎

MEmu := "BlueStacks"
MEmuV := "v0.7.10.869"
MURL := ["http://www.bluestacks.com/"]
MAuthor := ["djvj"]
MVersion := "2.0.1"
MCRC := "A606F2C1"
iCRC := "79D03371"
MID := "635038268876501094"
MSystem := ["Android"]
;----------------------------------------------------------------------------
; Notes:
; Set your Emu_Path to "PATH\HD-Frontend.exe" where bluestacks is installed, something like this: C:\Program Files (x86)\BlueStacks\HD-Frontend.exe
; Rom_Extension should be set to lnk
; Each game you install in BlueStacks will have a lnk shortcut made in your C:\ProgramData\BlueStacks\UserData\Library\My Apps
; Rom_Path should point to this Library folder
; If the HD-Agent does not quit after you exit a game, the next time you launch you will be back in the same Android Virtual Environment and the previous game will have crashed
; Due to this, some games may not save settings when you quit. It is advised you close the game in Android by normal means, then exit.
; BlueStacks stores its config in the registry @ HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks
;----------------------------------------------------------------------------
StartModule()
BezelGUI()
FadeInStart()
 primaryExe := new Process(emuPath . "\" . executable)		; instantiate emulator executable object
bsLnk := new Process(romPath . "\" . romName . romExtension)
emuQuitExe := new Process(emuPath . "\HD-Quit.exe")
emuPrimaryWindow := new Window(new WindowTitle("BlueStacks App Player",""))	; instantiate primary emulator window object
hideEmuObj := Object(emuPrimaryWindow,1)
 Fullscreen := moduleIni.Read("settings", "Fullscreen","true",,1)
userWidth := moduleIni.Read("settings", "Width","1600",,1)
emuHeight := moduleIni.Read("settings", "Height","900",,1)
WindowedWidth := moduleIni.Read("Settings", "WindowedWidth","750",,1)
WindowedHeight := moduleIni.Read("Settings", "WindowedHeight","450",,1)
 BezelStart("FixResMode")
 regLoc := "SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0"
currentFullScreen := Registry.Read("HKLM",regLoc,"FullScreen")
If (Fullscreen != "true" And currentFullScreen = 1)
	Registry.Write("REG_DWORD","HKLM",regLoc,"FullScreen",0)
Else If (Fullscreen = "true" And currentFullScreen = 0)
	Registry.Write("REG_DWORD","HKLM",regLoc,"FullScreen",1)
 If bezelPath {	; Setting windowed mode resolution
	userWidth := WindowedWidth
	userHeight := WindowedHeight
}
 currentWidth := Registry.Read("HKLM",regLoc,"Width")	; update width if desired width does not match current
If (userWidth != currentWidth and userWidth != "")
	Registry.Write("REG_DWORD","HKLM",regLoc,"Width",userWidth)
currentHeight := Registry.Read("HKLM",regLoc,"Height")	; update height if desired width does not match current
If (userHeight != currentHeight and userHeight != "")
	Registry.Write("REG_DWORD","HKLM",regLoc,"Height",userHeight)
 ; This makes sure there is no warning on exit
bsCloseWarning := Registry.Read("HKLM","SOFTWARE\BlueStacks\BlueStacksGameManager\Preferences","BlueStacksCloseWarning")
If (bsCloseWarning = 0)
	Registry.Write("REG_DWORD","HKLM","SOFTWARE\BlueStacks\BlueStacksGameManager\Preferences","BlueStacksCloseWarning",0)
; This makes sure TV window doesn't show
bsTVWindow := Registry.Read("HKLM","SOFTWARE\BlueStacks\BlueStacksGameManager\Preferences","HideBTVWindow")
If (bsTVWindow != 1)
	Registry.Write("REG_DWORD","HKLM","SOFTWARE\BlueStacks\BlueStacksGameManager\Preferences","HideBTVWindow",1)
 HideAppStart(hideEmuObj,hideEmu)
bsLnk.Run()
 emuPrimaryWindow.Wait()
emuPrimaryWindow.WaitActive()
 BezelDraw()
HideAppEnd(hideEmuObj,hideEmu)
FadeInExit()
emuPrimaryWindow.WaitClose()
 TimerUtils.Sleep(100)
emuQuitExe.Run()	; this is the provided exe to quit BlueStacks Agent
TrayRefresh()	; attempts to prevent dead icons from building up on your tray
 BezelExit()
FadeOutExit()
ExitModule()
  TrayRefresh() {
	Static WM_MOUSEMOVE := 0x200
	ControlGetPos,,,w,h,ToolbarWindow321, AHK_class Shell_TrayWnd
	width:=w, hight:=h
	while ((h:=h-5)>0 and w:=width)
	while ((w:=w-5)>0)
	PostMessage, WM_MOUSEMOVE,0, ((hight-h) >> 16)+width-w, ToolbarWindow321, AHK_class Shell_TrayWnd
}
 CloseProcess:
	FadeOutStart()
	emuPrimaryWindow.Close()
	primaryExe.Process("Close")
Return

Comments