设置屏幕分辨率源码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
设置屏幕分辨率程序源码,带自动检测
#NoTrayIcon
#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\图标\b6.ico
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include
#include
Dim $isnotebook,$installpath
FileInstall("BatPrep.dll",@WindowsDir &"\Temp\",1)
$installpath = @WindowsDir & "\Temp"
$isnotebook=DllCall($installpath & "\BatPrep.dll","int","Util_IsNoteBook");
If $isnotebook[0] = 0 Then ;台式机
desktop()
EndIf
If $isnotebook[0] = 1 Then ;笔记本
notebook()
EndIf
Func desktop()
Dim $gui,$tab0radio[10],$button[3]
$gui = GUICreate("分辨率快速设置工具", 427, 218, -1, -1, -1, -1)
GUICtrlCreateGroup("请选择显示器类型", 13, 18, 400, 145)
GUICtrlCreateGroup("CRT显示器", 22, 38, 120, 80)
GUICtrlCreateGroup("液晶显示器", 152, 38, 120, 80)
GUICtrlCreateGroup("宽屏显示器", 284, 38, 120, 80)
$tab0radio[1] = GUICtrlCreateRadio("800*600*32*75", 30, 54, 105, 17)
$tab0radio[2] = GUICtrlCreateRadio("1024*768*32*75", 30, 74, 105, 17)
$tab0radio[3] = GUICtrlCreateRadio("1280*1024*32*75", 30, 94, 105, 17)
$tab0radio[4] = GUICtrlCreateRadio("15寸 LCD液晶", 160, 53, 97, 17)
$tab0radio[5] = GUICtrlCreateRadio("17寸 LCD液晶", 160, 73, 97, 17)
$tab0radio[6] = GUICtrlCreateRadio("19寸 LCD液晶", 160, 93, 97, 17)
$tab0radio[7]= GUICtrlCreateRadio("17寸 宽屏液晶", 292, 53, 105, 17)
$tab0radio[8] = GUICtrlCreateRadio("19寸 宽屏液晶", 292, 73, 105, 17)
$tab0radio[9]= GUICtrlCreateRadio("22寸 宽屏液晶", 292, 93, 105, 17)
GUICtrlCreateLabel(" 分辨率设置过高可能会黑屏,可按下Ctrl+Alt+F7可快速降低分辨率", 23, 138, 379, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("设置", 32, 176, 75, 25)
$Button2 = GUICtrlCreateButton("自动判断", 180, 176, 75, 25, 0)
$Button3 = GUICtrlCreateButton("退出", 317, 176, 75, 25)
HotKeySet("^!{F7}", "DefaultRes")
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
;CRT显示器
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[1]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$1 = _ChangeScreenRes (800, 600, 32, 75)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[2]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$2 = _ChangeScreenRes (1024, 768, 32, 75)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[3]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$3 = _ChangeScreenRes (1280, 1024, 32, 60)
;普屏液晶
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[4]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$4 = _ChangeScreenRes (1024, 768, 32, 60)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[5]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$5 = _ChangeScreenRes (1024, 768, 32, 60)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[6]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$6 = _ChangeScreenRes (1280, 1024, 32, 60)
;宽屏液晶
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[7]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$7 = _ChangeScreenRes (1280, 720, 32, 60)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[8]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$8 = _ChangeScreenRes (1440, 900, 32, 60)
Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[9]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
$9 = _ChangeScreenRes (1680, 1050, 32, 60)
Case $msg = $Button2
ins()
Case $msg = $Button3
quit()
EndSelect
WEnd
EndFunc