蓝色动力网络

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 3711|回复: 0

设置屏幕分辨率程序+源码,带自动检测

[复制链接]
发表于 2010-3-14 19:08:40 | 显示全部楼层 |阅读模式
  1. #NoTrayIcon
  2. #Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
  3. #AutoIt3Wrapper_icon=..\..\图标\b6.ico
  4. #AutoIt3Wrapper_Compression=4
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6. #include <GUIConstants.au3>
  7. #include <ChangeScreenRes.au3>
  8. Dim $isnotebook,$installpath
  9. FileInstall("BatPrep.dll",@WindowsDir &"\Temp\",1)
  10. $installpath = @WindowsDir & "\Temp"
  11. $isnotebook=DllCall($installpath & "\BatPrep.dll","int","Util_IsNoteBook");
  12. If $isnotebook[0] = 0 Then   ;台式机
  13. desktop()
  14. EndIf
  15. If $isnotebook[0] = 1 Then  ;笔记本
  16. notebook()
  17. EndIf
  18. Func desktop()
  19. Dim $gui,$tab0radio[10],$button[3]
  20. $gui = GUICreate("分辨率快速设置工具", 427, 218, -1, -1, -1, -1)
  21. GUICtrlCreateGroup("请选择显示器类型", 13, 18, 400, 145)
  22. GUICtrlCreateGroup("CRT显示器", 22, 38, 120, 80)
  23. GUICtrlCreateGroup("液晶显示器", 152, 38, 120, 80)
  24. GUICtrlCreateGroup("宽屏显示器", 284, 38, 120, 80)
  25. $tab0radio[1] = GUICtrlCreateRadio("800*600*32*75", 30, 54, 105, 17)
  26. $tab0radio[2] = GUICtrlCreateRadio("1024*768*32*75", 30, 74, 105, 17)
  27. $tab0radio[3] = GUICtrlCreateRadio("1280*1024*32*75", 30, 94, 105, 17)
  28. $tab0radio[4] = GUICtrlCreateRadio("15寸 LCD液晶", 160, 53, 97, 17)
  29. $tab0radio[5] = GUICtrlCreateRadio("17寸 LCD液晶", 160, 73, 97, 17)
  30. $tab0radio[6] = GUICtrlCreateRadio("19寸 LCD液晶", 160, 93, 97, 17)
  31. $tab0radio[7]= GUICtrlCreateRadio("17寸 宽屏液晶", 292, 53, 105, 17)
  32. $tab0radio[8] = GUICtrlCreateRadio("19寸 宽屏液晶", 292, 73, 105, 17)
  33. $tab0radio[9]= GUICtrlCreateRadio("22寸 宽屏液晶", 292, 93, 105, 17)
  34. GUICtrlCreateLabel("   分辨率设置过高可能会黑屏,可按下Ctrl+Alt+F7可快速降低分辨率", 23, 138, 379, 17)
  35. GUICtrlSetColor(-1, 0xFF0000)
  36. GUICtrlCreateGroup("", -99, -99, 1, 1)
  37. $Button1 = GUICtrlCreateButton("设置", 32, 176, 75, 25)
  38. $Button2 = GUICtrlCreateButton("自动判断", 180, 176, 75, 25, 0)
  39. $Button3 = GUICtrlCreateButton("退出", 317, 176, 75, 25)
  40. HotKeySet("^!{F7}", "DefaultRes")
  41. GUISetState(@SW_SHOW)
  42. While 1
  43. $msg = GUIGetMsg()
  44. Select
  45.   Case $msg = $GUI_EVENT_CLOSE
  46.    ExitLoop
  47.   ;CRT显示器
  48.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[1]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  49.    $1 = _ChangeScreenRes (800, 600, 32, 75)
  50.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[2]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  51.    $2 = _ChangeScreenRes (1024, 768, 32, 75)
  52.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[3]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  53.    $3 = _ChangeScreenRes (1280, 1024, 32, 60)
  54.   ;普屏液晶
  55.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[4]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  56.    $4 = _ChangeScreenRes (1024, 768, 32, 60)
  57.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[5]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  58.    $5 = _ChangeScreenRes (1024, 768, 32, 60)
  59.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[6]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  60.    $6 = _ChangeScreenRes (1280, 1024, 32, 60)
  61.   ;宽屏液晶
  62.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[7]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  63.    $7 = _ChangeScreenRes (1280, 720, 32, 60)
  64.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[8]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  65.    $8 = _ChangeScreenRes (1440, 900, 32, 60)
  66.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[9]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  67.    $9 = _ChangeScreenRes (1680, 1050, 32, 60)
  68.   Case $msg = $Button2
  69.    ins()
  70.   Case $msg = $Button3
  71.    quit()  
  72. EndSelect
  73. WEnd
  74. EndFunc
  75. Func notebook()
  76. Dim $gui,$tab0radio[16],$button[3]
  77. $gui = GUICreate("分辨率快速设置工具", 427, 304, -1, -1, -1, -1)
  78. GUICtrlCreateGroup("请选择显示器类型", 13, 18, 400, 225)
  79. GUICtrlCreateGroup("CRT显示器", 22, 38, 120, 80)
  80. GUICtrlCreateGroup("液晶显示器", 152, 38, 120, 80)
  81. GUICtrlCreateGroup("宽屏显示器", 284, 38, 120, 80)
  82. GUICtrlCreateGroup("笔记本显示器", 22, 130, 382, 73)
  83. $tab0radio[1] = GUICtrlCreateRadio("800*600*32*75", 30, 54, 105, 17)
  84. $tab0radio[2] = GUICtrlCreateRadio("1024*768*32*75", 30, 74, 105, 17)
  85. $tab0radio[3] = GUICtrlCreateRadio("1280*1024*32*75", 30, 94, 105, 17)
  86. $tab0radio[4] = GUICtrlCreateRadio("15寸 LCD液晶", 160, 53, 97, 17)
  87. $tab0radio[5] = GUICtrlCreateRadio("17寸 LCD液晶", 160, 73, 97, 17)
  88. $tab0radio[6] = GUICtrlCreateRadio("19寸 LCD液晶", 160, 93, 97, 17)
  89. $tab0radio[7] = GUICtrlCreateRadio("17寸 宽屏液晶", 292, 53, 105, 17)
  90. $tab0radio[8] = GUICtrlCreateRadio("19寸 宽屏液晶", 292, 73, 105, 17)
  91. $tab0radio[9]= GUICtrlCreateRadio("22寸 宽屏液晶", 292, 93, 105, 17)
  92. $tab0radio[10] = GUICtrlCreateRadio("XGA", 30, 152, 105, 17)
  93. GUICtrlSetTip(-1, "    这是一种目前笔记本普遍采用的一种LCD屏幕,市面上将近有80%的笔记本采用了这" _
  94. [email=&@CRLF]&@CRLF[/email] &"种产品。它支持最大1024×768分辨率,屏幕大小从10.4英寸、12.1英寸、13.3英寸到"[email=&@CRLF]&@CRLF[/email] &"14.1英寸、15.1英寸都有。")
  95. $tab0radio[11] = GUICtrlCreateRadio("SXGA+", 158, 152, 105, 17)
  96. GUICtrlSetTip(-1, "    作为SXGA的一种扩展SXGA+是一种专门为笔记本设计的屏幕。其显示分辨率为1400×1050。" _
  97. [email=&@CRLF]&@CRLF[/email] &"由于笔记本LCD屏幕的水平与垂直点距不同于普通桌面LCD,所以其显示的精度要比普通17英寸的"[email=&@CRLF]&@CRLF[/email] &"桌面LCD高出不少。")
  98. $tab0radio[12] = GUICtrlCreateRadio("WXGA", 290, 150, 105, 17)
  99. GUICtrlSetTip(-1, "    作为普通XGA屏幕的宽屏版本,WXGA采用16:10的横宽比例来扩大屏幕的尺寸。其最大" _
  100. [email=&@CRLF]&@CRLF[/email] &"显示分辨率为1280×800。由于其水平像素只有800,所以除了一般15英寸的本本之外,也有"[email=&@CRLF]&@CRLF[/email] &"12.1英寸的本本采用了这种类型的屏幕。")
  101. $tab0radio[13] = GUICtrlCreateRadio("WXGA+", 30, 176, 105, 17)
  102. GUICtrlSetTip(-1, "    这是一种WXGA的的扩展,其最大显示分辨率为1280×854。由于其横宽比例为15:10而" _
  103. [email=&@CRLF]&@CRLF[/email] &"非标准宽屏的16:10。所以只有少部分屏幕尺寸在15.2英寸的本本采用这种产品。")
  104. $tab0radio[14] = GUICtrlCreateRadio("WSXGA+", 158, 176, 105, 17)
  105. GUICtrlSetTip(-1, "    其显示分辨率为1680×1050,除了大多数15英寸以上的宽屏笔记本以外,目前较为流行" _
  106. [email=&@CRLF]&@CRLF[/email] &"的大尺寸LCD-TV也都采用了这种类型的产品。")
  107. $tab0radio[15] = GUICtrlCreateRadio("WUXGA+", 290, 173, 105, 17)
  108. GUICtrlSetTip(-1, "    WUXGA屏幕是非常少见的,其显示分辨率可以达到1920×1200。由于售价实在是太高" _
  109. [email=&@CRLF]&@CRLF[/email] &"所以鲜有笔记本厂商采用这种屏幕。")
  110. GUICtrlCreateLabel("   分辨率设置过高可能会黑屏,可按下Ctrl+Alt+F7可快速降低分辨率", 24, 218, 379, 17)
  111. GUICtrlSetColor(-1, 0xFF0000)
  112. GUICtrlCreateGroup("", -99, -99, 1, 1)
  113. $Button1 = GUICtrlCreateButton("设置", 32, 264, 75, 25)
  114. $Button2 = GUICtrlCreateButton("自动判断", 180, 264, 75, 25, 0)
  115. $Button3 = GUICtrlCreateButton("退出", 317, 264, 75, 25)
  116. HotKeySet("^!{F7}", "DefaultRes")
  117. GUISetState(@SW_SHOW)
  118. While 1
  119. $msg = GUIGetMsg()
  120. Select
  121.   Case $msg = $GUI_EVENT_CLOSE
  122.    ExitLoop
  123.   ;CRT显示器  
  124.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[1]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  125.    $1 = _ChangeScreenRes (800, 600, 32, 75)
  126.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[2]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  127.    $2 = _ChangeScreenRes (1024, 768, 32, 75)
  128.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[3]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  129.    $3 = _ChangeScreenRes (1280, 1024, 32, 60)
  130.   ;普屏液晶
  131.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[4]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  132.    $4 = _ChangeScreenRes (1024, 768, 32, 60)
  133.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[5]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  134.    $5 = _ChangeScreenRes (1024, 768, 32, 60)
  135.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[6]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  136.    $6 = _ChangeScreenRes (1280, 1024, 32, 60)
  137.   ;宽屏液晶
  138.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[7]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  139.    $7 = _ChangeScreenRes (1280, 720, 32, 60)
  140.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[8]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  141.    $8 = _ChangeScreenRes (1440, 900, 32, 60)
  142.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[9]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  143.    $9 = _ChangeScreenRes (1680, 1050, 32, 60)
  144.   ;笔记本 XGA
  145.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[10]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  146.    $10 = _ChangeScreenRes (1024, 768, 32, 60)
  147.   ;SXGA+
  148.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[11]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  149.    $11 = _ChangeScreenRes (1400, 1050, 32, 60)
  150.   ;WXGA
  151.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[12]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  152.    $12 = _ChangeScreenRes (1280, 800, 32, 60)
  153.   ;WXGA+
  154.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[13]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  155.    $13 = _ChangeScreenRes (1280, 854, 32, 60)
  156.   ;WSXGA+
  157.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[14]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  158.    $14 = _ChangeScreenRes (1680, 1050, 32, 60)
  159.   ;
  160.   Case $Msg = $Button1 And BitAND(GUICtrlRead($tab0radio[15]), $GUI_CHECKED) = $GUI_CHECKED ;BitAND为按位"与"运算
  161.    $15 = _ChangeScreenRes (1920, 1200, 32, 60)
  162.   ;WUXGA+
  163.   Case $msg = $Button2
  164.    ins()
  165.   Case $msg = $Button3
  166.    quit()  
  167. EndSelect
  168. WEnd
  169. EndFunc
  170. Func quit()
  171. FileDelete($installpath & "\BatPrep.dll")
  172. Exit
  173. EndFunc
  174. Func ins()
  175. FileInstall("sc2.exe",@TempDir & "\",1)
  176. RunWait(@TempDir & "\sc2.exe","",@SW_HIDE)
  177. FileDelete(@TempDir & "\sc2.exe")
  178. EndFunc
  179. Func DefaultRes()
  180. _ChangeScreenRes (640, 480, 16, 60)
  181. EndFunc   ;==>DefaultRes
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

蓝色动力网络微信平台
网站管理,业务合作联系邮箱: admin#lansedongli.com    QQ:13412492 限网站业务问题.
网站帐号、密码、密保找回请使用注册邮箱,发送邮件至 password#lansedongli.com ,否则不予受理.
免责声明:本论坛所有文字和图片仅代表其个人观点.
本站某些资料或文章来自于互联网,不代表本站观点,如果侵犯了您的权益,请来信告知,我们会在三天内删除.
为了给大家一个更好的交流场所,请勿在本论坛发表与中华人民共和国法律相抵触的言论,请合作,谢谢!
Copyright © 2007-2019 Corporation Powered by网吧系统 版权所有    转载请注明!
浙ICP备11043737号-1 程序:Discuz! x3.4

湘公网安备 43018102000145号

手机版|Archiver|蓝色动力网络   

快速回复 返回顶部 返回列表