Post by Admin on Dec 6, 2023 20:53:19 GMT
A GUI for QRes. Download QRes Here
Lists all the available resolutions for your graphics hardware.
Allows user to select and change to another resolution.
Lists all the available resolutions for your graphics hardware.
Allows user to select and change to another resolution.
'GUI for QRes
'by xxgeek Nov 2023
'change display resolution at will
'download QRES.exe and put it in the same folder as this code is run from
'https://www.majorgeeks.com/files/details/qres.html
'Esc or Alt+F4 closes the window when in focus, as well as the top item in the list 'EXIT'
'F4 alone drops the combobox list
'+ = increase font size - = decrease font size X = close program
dim res$(500)
nomainwin
WindowWidth = 850:WindowHeight = 58
UpperLeftX= int((DisplayWidth-WindowWidth)/2)
UpperLeftY= int((DisplayHeight-DisplayHeight))+10
button #res.incFont, "&+", [incFont], UL, 250, 1, 30, 25
button #res.decFont, "&-", [decFont], UL, 280, 1, 30, 25
button #res.close, "&X", [quit.res], UL, 310, 1, 30, 25
combobox #res.resolution, res$(), resSelected , 0, 0, 250, 30
open "Built-In" for dialog_popup as #res
#res "trapclose [quit.res]"
gosub [getResolutions]
#res "font 12 bold"
mainFontsize = 12
run "cmd.exe /c QRes.exe /L > reslist.res",hide 'Lists ALL possible resolutions of the installed video hardware.
gosub [check]
wait
[quit.res]
close #res
end
[getResolutions]
x=1
if fileExists(DefaultDir$, "reslist.res") then
open "reslist.res" for input as #1
while eof(#1) = 0
line input #1, res$(x)
x=x+1
wend
close #1
res$(0) = " Available Resolutions"
res$(1) = " "
res$(2) = ""
#res.resolution "reload"
#res.resolution "! R E S O L U T I O N S"
end if
return
end
'resize window font - sets all fonts equal
[incFont]
mainFontsize = mainFontsize + 1
#res.resolution "font ";mainFontsize;" bold"
wait
[decFont]
mainFontsize = mainFontsize - 1
#res.resolution "font ";mainFontsize;" bold"
wait
[check]
do
scan
loop until fileExists(DefaultDir$, "reslist.res")
return
sub resSelected res$
#res.resolution "selection? selectedRes$"
if selectedRes$ <> " " and selectedRes$ <> " Available Resolutions" then
x$ = word$(selectedRes$, 1 , "x")
y$ = word$(selectedRes$, 1, ",") : y$ = word$(y$, 2, "x")
run "cmd.exe /c QRes /x ";x$;" /y ";y$;" /D /C:16",hide
end if
#res.resolution "! R E S O L U T I O N S"
end sub
'Verify file existence function
function fileExists(path$, filename$)
dim fileExistsInfo$(0,0)
files path$, filename$, fileExistsInfo$()
fileExists = val(fileExistsInfo$(0, 0)) 'non zero is true
end function
'#################################################################
'QRes /? 'displays the help menu for QRES
'QRes /H 'displays a bit more help
'syntax
'QRES [/X:[px]] [/Y:[px]] [/C:[bits] [/R:[rr]] [/S] [/L] [/D] [/V] [/?] [/H]
' /X Width in pixels.
' /Y Height in pixels.
' /C Color depth.
' 4 = 16 colors.
' 8 = 256 colors.
' 16= High color.
' 24= True color.
' 32= True color.
' /R Refresh rate.
' /S Show current display settings.
' /L List all display modes.
' /D Does NOT save display settings in the registry..
' /V Does NOT display version information.
' /? Displays usage information.
' /H Displays more help.
'Example: "QRes.exe /x:640 /c:8" Changes resolution to 640 x 480 and the color depth to 256 colors.
'run "cmd.exe /k QRes.exe /x 1366 /y 768 /D /V" ' /D = no registry entries made /V = No version info is displayed
'run "cmd.exe /c QRes.exe /x 1366 /y 768"
'run "cmd.exe /k QRes.exe /S" ' displays the current resolution, bit rate, refresh rate
'run "cmd.exe /k QRes.exe /x 1920 /y 1080" 'cmd.exe /k leaves the command window open
'run "cmd.exe /c QRes.exe /x 1920 /y 1080" 'cmd.exe /c closes the command window when finished changing resolution
'run "cmd.exe /c QRes.exe /x 1600 /y 1200 /D"
'run "cmd.exe /c QRes.exe /x 1600 /y 900" /D"
'run "cmd.exe /c QRes.exe /x 1400 /y 1050" /D"
'run "cmd.exe /c QRes.exe /x 1280 /y 1024" /D"
'run "cmd.exe /c QRes.exe /x 1280 /y 720" /D"
'run "cmd.exe /c QRes.exe /x 1152 /y 864" /D"
'run "cmd.exe /c QRes.exe /x 1024 /y 768" /D"
'run "cmd.exe /c QRes.exe /x 800 /y 600" /D"
'#############################################################