找回密码
 加入
搜索
查看: 16323|回复: 47

[原创] 美化窗口完整源代码

 火... [复制链接]
发表于 2010-3-18 11:38:28 | 显示全部楼层 |阅读模式
在Win 7 下测试通过,Opt("OnExitFunc","Quit") 不加载此代码 也能正常关闭窗口,但是在点击窗口后经常闪烁。
#include <GUIConstants.au3>
#include <Misc.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Opt("GUIOnEventMode", 1)
Dim $dll

_Singleton("Hardware_info")

Global $hGui,$bios,$board,$cpu,$display,$sound,$network,$mem,$os

SplashImageOn("logo","Splash.jpg",425,200,-1,-1,1)

$hGui=GUICreate ("                     窗口美化",450,400,-1,-1)
Dim $bf="E.skf"
_SkinGUI("SkinCrafterDll.dll",$bf,$hGui)
GUISetOnEvent($GUI_EVENT_CLOSE, "_hGuiMsg")
;选择窗口皮肤路径和文件

GUICtrlCreateGroup ("信息选项", 10, 10, 430, 360)

GUICtrlCreateButton("C  P  U",25,40,80,30)
$cpu=GUICtrlCreateInput("",120,40,270,30,$ES_READONLY)

GUICtrlCreateButton("B I O S",25,80,80,30)
$bios=GUICtrlCreateInput("",120,80,270,30,$ES_READONLY)


GUICtrlCreateButton("主    板",25,120,80,30)
$board=GUICtrlCreateInput("",120,120,270,30,$ES_READONLY)


GUICtrlCreateButton("显    卡",25,160,80,30)
$display=GUICtrlCreateInput("",120,160,270,30,$ES_READONLY)

GUICtrlCreateButton("声    卡",25,200,80,30)
$sound=GUICtrlCreateInput("",120,200,270,30,$ES_READONLY)

GUICtrlCreateButton("网    卡",25,240,80,30)
$network=GUICtrlCreateInput("",120,240,270,30,$ES_READONLY)

GUICtrlCreateButton("内    存",25,280,80,30)
$mem=GUICtrlCreateInput("",120,280,270,30,$ES_READONLY)

GUICtrlCreateButton("操作系统",25,320,80,30)
$os=GUICtrlCreateInput("",120,320,270,30,$ES_AUTOHSCROLL+$ES_READONLY)

GUICtrlCreateGroup ("",-99,-99,1,1)
GUICtrlCreateLabel("Autoit 中文论坛 www.autoitx.com 倾情奉献",15,370,300,30)
GUICtrlCreateLabel("Make By Sanhen",350,370,100,30)

               

GUISetState()

info()
SplashOff()
While 1
       
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', @AutoItPID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall("kernel32.dll" , 'int', 'CloseHandle', 'int', $ai_Handle[0])
Sleep(1000)

Wend

Func _hGuiMsg()
  Switch @GUI_CTRLID
          
            Case  $GUI_EVENT_CLOSE
                         Exit                                                       
        Case $GUI_EVENT_MINIMIZE
                guisetstate(@SW_MINIMIZE)
        Case $GUI_EVENT_RESTORE
                guisetstate(@SW_RESTORE)
                EndSwitch
               
EndFunc  ;==>_hGuiMsg()
       
Func info()
      
Global $objWMIService,$colBios,$colBoard,$colSettings,$colMemory,$colCPU,$colVideoinfo,$colSound ,$colNIC

Local $object,$objOperatingSystem
$objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colBios = $objWMIService.ExecQuery("Select * from Win32_BIOS")
$colBoard = $objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard")
$colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
$colMemory = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
$colCPU = $objWMIService.ExecQuery("Select * from CIM_Processor")
$colVideoinfo = $objWMIService.ExecQuery("Select * from Win32_VideoController")
$colSound = $objWMIService.ExecQuery("Select * from Win32_SoundDevice")
$colNIC = $objWMIservice.ExecQuery("Select * from Win32_NetworkAdapter WHERE Netconnectionstatus = 2")

For $object in $colCPU
        GUICtrlSetData($cpu, StringStripWS($object.Name,1))
Next
       
For $object in $colBios
        GUICtrlSetData($bios,StringMid($object.Caption,1))
Next



For $object in $colBoard
        GUICtrlSetData($board,$object.Product)
        
Next




For $object in $colVideoinfo
        GUICtrlSetData($display, StringStripWS($object.Description ,1))
  
Next

For $object in $colSound
        GUICtrlSetData($sound, StringStripWS($object.Description ,1))
  Next

For $object in $colNIC
        GUICtrlSetData($network, StringStripWS($object.name ,1))
  
Next


For $objOperatingSystem in $colSettings

GUICtrlSetData($os,$objOperatingSystem.Caption & " Build " & $objOperatingSystem.BuildNumber & " Sp " & $objOperatingSystem.ServicePackMajorVersion & "." & $objOperatingSystem.ServicePackMinorVersion )

Next
for $object  in $colMemory
        GUICtrlSetData($mem,String(Int(Number($object.TotalPhysicalMemory) / (1024 * 1024))) & " Mb")
Next

EndFunc  ;==>Info()
发表于 2010-3-18 11:45:00 | 显示全部楼层
原创的?这就是三恨的不是了,他抄袭你老的东西。唉。。。。
发表于 2010-3-18 13:09:32 | 显示全部楼层
难道是三恨改名了,楼主转贴也不说清楚,还打上原创,如果是自己修改的应该加上原作者啊。。。
发表于 2010-3-19 19:46:52 | 显示全部楼层
而且_SkinGUI函数还没给哦
发表于 2010-3-20 10:38:53 | 显示全部楼层
路过,看一看~~~~~~~~~~~~~~~~·
发表于 2010-3-20 13:55:06 | 显示全部楼层
新手。。学习中
发表于 2010-4-1 16:01:48 | 显示全部楼层
可惜我没有装,还用win2003
发表于 2010-4-1 20:40:38 | 显示全部楼层
看不懂 学习中。。。。
发表于 2010-4-2 14:06:20 | 显示全部楼层
好贴!大力支持!
发表于 2010-4-3 18:32:06 | 显示全部楼层
测试下,好看不/
发表于 2010-4-4 02:32:43 | 显示全部楼层
这不是你的东西吧~!也太那个啥了吧~!~!!
发表于 2010-4-21 18:53:19 | 显示全部楼层
看不太懂呀学习中
发表于 2010-4-22 17:24:58 | 显示全部楼层
路过!看一下!
发表于 2010-4-22 21:29:40 | 显示全部楼层
谢谢分享,,收藏
发表于 2010-6-9 09:08:04 | 显示全部楼层
  真的原创?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-23 18:14 , Processed in 0.096322 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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