【发布时间】:2021-04-12 21:01:28
【问题描述】:
我想使用 nim 来调整机器上的默认显示分辨率(仅限 Windows 10),我想基本上通过像 setDisplay 1280 1024 这样的命令行调用来完成它
我已经看到并使用了 python 示例Resize display resolution using python with cross platform support,我可以学习,但无法翻译。我只是不明白如何填写 EnumDisplaySettings
import winim/lean
import strformat
var
cxScreen = GetSystemMetrics(SM_CXSCREEN)
cyScreen = GetSystemMetrics(SM_CYSCREEN)
msg = fmt"The screen is {cxScreen} pixels wide by {cyScreen} pixels high."
EnumDisplaySettings(Null,0, 0) #total type mismatch
MessageBox(0, msg, "Winim Example Screen Size", 0)
尝试检查 https://cpp.hotexamples.com/fr/examples/-/-/EnumDisplaySettings/cpp-enumdisplaysettings-function-examples.html 之类的内容,但没有太大帮助,https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-changedisplaysettingsa 也是如此
【问题讨论】:
标签: nim-lang