我正在尝试从INI文件中读取两个值,我知道它读取得很好(已通过msgbox测试),但是它似乎无法运行该变量,我想我做错了。如果我直接放置一个数字而不是变量(MonitorRight和MonitorBottom),它可以正常工作并更改分辨率,但是我需要在其中放置一个变量。
有什么想法吗?
#NoTrayIcon
IniRead, resolution, %A_WorkingDir%\configuration.ini, Various, Resolutions
IniRead, MonitorRight, %A_WorkingDir%\configuration.ini, Various, Width
IniRead, MonitorBottom, %A_WorkingDir%\configuration.ini, Various, Height
if (resolution = "2") {
ChangeDisplaySettings( (ClrDep:=32) , (Wid:=%MonitorRight%) , (Hei:=%MonitorBottom%) , (Hz:=60) )
ChangeDisplaySettings( cD, sW, sH, rR ) {
VarSetCapacity(dM,156,0), NumPut(156,dM,36)
DllCall( "EnumDisplaySettingsA", 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( "ChangeDisplaySettingsA", UInt,&dM, UInt,0 )
}
}