加载皮肤后退出会报错,进来看看就知道有新鲜问题了.
下面是代码:#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
$mylogs="application"
$mylogs="system"
$mylogs="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 编辑 ] func 可以被嵌套 ?:face (7): 可以的啊....... 难道大家都去睡觉了吗?
没夜猫了??? 退出前需要先卸载掉皮肤~ 原帖由 298311657 于 2009-3-21 09:44 发表 http://www.autoitx.com/images/common/back.gif
退出前需要先卸载掉皮肤~
任何皮肤都得这么做.
你可以加在OnAutoitExit函数里 哦...谢谢各位大大哥们...
我试试先... 版本换到3.3.0.0.1就没问题了...
我都习惯性的用旧版本...难怪都有这些问题... 哦...还没解决...在2003系统上退出没问题...XP上退出有问题...不关版本问题。.. xp下正常。 既然解决不了就先不解决了.....
放一边先......................................
页:
[1]