下面是代码:
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
FileInstall("vista_style.skf", @TempDir & "\vista_style.skf", 1)
$Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
$Form1_1 = GUICreate("", 230, 132, 193, 115)
$Button1 = GUICtrlCreateButton("清除系统日志",48, 24, 129, 65, 0)
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\vista_style.skf", $Form1_1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("WinTitleMatchMode", 2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
exit
Case $Button1
_CleanEvent(1)
Func _CleanEvent($s=1)
$strComputer= "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate,(Backup)}!\\" & $strComputer & "\root\cimv2")
Dim $mylogs[4]
$mylogs[1]="application"
$mylogs[2]="system"
$mylogs[3]="security"
For $logs in $mylogs
$colLogFiles = $objWMIService.ExecQuery ('Select * from Win32_NTEventLogFile where LogFileName="' & $logs & '"')
For $objLogfile in $colLogFiles
$objLogFile.ClearEventLog()
Next
Next
EndFunc
EndSwitch
WEnd
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
$Dll = DllOpen($SkincrafterDll)
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc
大家帮我试一下好吗?
我试过只要删除下面代码的其中一条或者两条都删了,退出就不会出现异常,但是皮肤却不见了.
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
我研究了好久,都解决不了,所以来这里问问了...我换过几个版本退出都一样的有问题.
小的不才,麻烦大家帮帮忙啦...
顺便上传我脚本所需要的皮肤吧...
[ 本帖最后由 laojikelly 于 2009-3-21 23:59 编辑 ] |