Hello everyone.
For several years, I've managed a couple of different crt_emudriver setups using AutoHotkey to change to the right resolution before launching certain applications.
Up until now, I've been using the following function I grabbed at some point from the AutoHotjey forums:
ChangeResolution( cD, sW, sH, rR ) {
VarSetCapacity(dM,156,0), NumPut(156,2,&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 )
}
In Windows 7, this works perfectly. It allows me to change to any driver-enabled resolution.
However, I recently started using Windows 10 in one of these setups, and I haven't been able to achieve the same freedom.
When using this script, I can get it to change resolutions down to a certain size (ex.: 800x480i, 640x480i). But when trying to change to the smaller end of the resolutions list (ex.: 320x240p, 256x224p), the script does nothing, even though these resolutions are available.
However, they can be enabled manually, either through Arcade OSD, or within applications that do their own resolution switching (ex.: RetroArch), or through the "Display settings" menu:

Something I noticed, and might be related to this, is that the smaller resolutions I'm unable to access through scripts are not being listed in the "List of valid modes" found in Advance Display Settings.

Any leads on how to fix this?
Something on the script I'm using, or the specific DLL calls used?
Maybe a way of adding the smaller modes to the "List of valid modes" and see if that fixes it?
Any suggestions of workarounds or external apps are also welcome. Anything I can use to continue switching resolutions through scripts.
Thanks in advance!
Edit: I found a solution, using a program called "QRes", which does screen resolution changes from the command line.
https://www.autohotkey.com/boards/viewtopic.php?style=19&p=366359#p366359