#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#Persistent
procName := "ForgedAlliance.exe"
SetTimer, CheckProc, 2000
Return
CheckProc:
If (!ProcessExist(procName))
Return
WinGet Style, Style, % "ahk_exe " procName
If (Style & 0xC40000)
{
DPI_F:=DPIFactor()
ChangeDisplaySettings( (ClrDep:=32) , (Wid:=1920) , (Hei:=1080) , (Hz:=60) )
WinSet, Style, -0xC40000, % "ahk_exe " procName
WinMinimize, % "ahk_exe " procName
WinMaximize, % "ahk_exe " procName
Run, %comspec% /c process -a forgedalliance.exe 111111111110
Run, %comspec% /c process -p forgedalliance.exe high
}
Return
ProcessExist(exeName)
{
Process, Exist, %exeName%
return !!ERRORLEVEL
}
return
DPIFactor()
{
RegRead, DPI_value, HKEY_CURRENT_USER, Control Panel\Desktop\WindowMetrics, AppliedDPI
; the reg key was not found - it means default settings
; 96 is the default font size setting
if (errorlevel=1) OR (DPI_value=96 )
return 1
else
Return DPI_Value/96
}
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 )
}
Statistics: Posted by benikens — 23 May 2016, 06:24
Statistics: Posted by arkitect — 18 May 2016, 06:21
Statistics: Posted by benikens — 17 May 2016, 13:41
Statistics: Posted by biass — 17 May 2016, 13:10