找回密码
 加入
搜索
查看: 1683|回复: 10

加载皮肤后退出会报错,进来看看就知道有新鲜问题了.

[复制链接]
发表于 2009-3-21 02:24:04 | 显示全部楼层 |阅读模式
下面是代码:

#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 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-3-21 03:22:10 | 显示全部楼层
func 可以被嵌套 ?
 楼主| 发表于 2009-3-21 04:04:13 | 显示全部楼层
可以的啊.......
 楼主| 发表于 2009-3-21 04:27:01 | 显示全部楼层
难道大家都去睡觉了吗?
没夜猫了???
发表于 2009-3-21 09:44:10 | 显示全部楼层
退出前需要先卸载掉皮肤~
发表于 2009-3-21 11:57:28 | 显示全部楼层
原帖由 298311657 于 2009-3-21 09:44 发表
退出前需要先卸载掉皮肤~


任何皮肤都得这么做.
你可以加在OnAutoitExit函数里
 楼主| 发表于 2009-3-21 23:36:10 | 显示全部楼层
哦...谢谢各位大大哥们...
我试试先...
 楼主| 发表于 2009-3-21 23:58:31 | 显示全部楼层
版本换到3.3.0.0.1就没问题了...
我都习惯性的用旧版本...难怪都有这些问题...
 楼主| 发表于 2009-3-22 03:41:41 | 显示全部楼层
哦...还没解决...在2003系统上退出没问题...XP上退出有问题...不关版本问题。..
发表于 2009-3-22 12:30:16 | 显示全部楼层
xp下正常。
 楼主| 发表于 2009-3-24 03:30:57 | 显示全部楼层
既然解决不了就先不解决了.....
放一边先......................................
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 15:44 , Processed in 0.085131 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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