找回密码
 加入
搜索
查看: 5410|回复: 12

[GUI管理] 界面加载皮肤 后老是被遮挡[已解决]

 火.. [复制链接]
发表于 2011-9-14 20:48:53 | 显示全部楼层 |阅读模式
本帖最后由 DenQ 于 2011-11-23 20:30 编辑

就像下面这样,这是皮肤文件的问题么?

PS: 已经换成she的皮肤了
   

   源码:
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=图标.exe
#AutoIt3Wrapper_Res_Comment=QQ:196019441
#AutoIt3Wrapper_Res_Description=定时提醒
#AutoIt3Wrapper_Res_Fileversion=1.0.0.27
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=冬丶
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <DateTimeConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GuiStatusBar.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <排列.au3>
#include <Date.au3> ;时间
#include <FTPEx.au3> ;从FTP读取数据

Opt("TrayMenuMode", 1) ;屏蔽托盘,暂停
Opt("TrayOnEventMode", 1)
Opt("GUIOnEventMode", 1)
TraySetClick(16) ;屏蔽托盘单击
Opt("GUICloseOnESC", 0) ;关闭ESC
Dim $NoRe = "", $ini = @ScriptDir & "\Set.ini", $Tempini = @TempDir & "\Set.ini"
$Runreg = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$Regname = "提醒工具"

FileInstall("皮肤\SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1) ;皮肤DLL
FileInstall("皮肤\Letter.skf", @TempDir & "\Letter.skf", 1) ;皮肤样式

$Form1 = GUICreate("提醒工具", 430, 418, 192, 124)
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\Letter.skf", $Form1)
$date_2 = GUICtrlCreateDate("", 15, 34, 80, 20, BitOR($DTS_TIMEFORMAT, $DTS_UPDOWN))
$Button1 = GUICtrlCreateButton("加入", 367, 30, 49, 25)
GUICtrlSetOnEvent(-1, "Onvent_Click_button1")
$Label2 = GUICtrlCreateLabel("说明: 5分钟自动同步配置(最小化隐藏) ", 15, 10, 220, 17)
$Label3 = GUICtrlCreateLabel("", 250, 10, 180, 17) ;当前时间控件
$Group1 = GUICtrlCreateGroup(" 任 务 提 醒 ", 15, 65, 401, 321)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input1 = GUICtrlCreateInput("", 103, 33, 211, 21)
$Checkbox1 = GUICtrlCreateCheckbox("强制", 323, 23, 41, 41)

$lv = GUICtrlCreateListView("", 28, 84, 375, 290, $LVS_REPORT)
GUICtrlSetOnEvent(-1, "_Lvpx")
_GUICtrlListView_AddColumn($lv, "时间", 50, 0)
_GUICtrlListView_AddColumn($lv, "提醒内容", 300, 0)
_GUICtrlListView_AddColumn($lv, "强制", 300, 0)
_GUICtrlListView_SetColumnWidth($lv, 0, 60)
_GUICtrlListView_SetColumnWidth($lv, 1, 265)
_GUICtrlListView_SetColumnWidth($lv, 2, 40)
_GUICtrlListView_SetExtendedListViewStyle($lv, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))
GUICtrlRegisterListViewSort(-1, "LVSort")

;--------------------------------->>主界面菜单
$menu = GUICtrlCreateMenu("菜单(&M)")
$menu_1 = GUICtrlCreateMenu("开机启动(&R)", $menu)
$menu_1_1 = GUICtrlCreateMenuItem("启动(&Y)", $menu_1)
GUICtrlSetOnEvent(-1, "Autoruns")
$menu_1_2 = GUICtrlCreateMenuItem("不启动(&N)", $menu_1)
GUICtrlSetOnEvent(-1, "Notrun")
$menu_2 = GUICtrlCreateMenuItem("退出程序(&X)", $menu)
GUICtrlSetOnEvent(-1, "_Exit")
$menu2 = GUICtrlCreateMenu("关于(&A)")
$menu2_1 = GUICtrlCreateMenuItem("关于程序(&X)", $menu2)
GUICtrlSetOnEvent(-1, "Aboutcx")
;<<--------------------------------主界面菜单

;------------------------->>程序GUI右键菜单
$ctextmenu = GUICtrlCreateContextMenu($lv)
$ctextmenu_1 = GUICtrlCreateMenuItem("删除提醒(&D)", $ctextmenu)
GUICtrlSetOnEvent(-1, "_Deleteitem")
$ctextmenu_4 = GUICtrlCreateMenuItem("同步提醒(&R)", $ctextmenu)
GUICtrlSetOnEvent(-1, "_Getini")
GUICtrlCreateMenuItem("", $ctextmenu) ; 右键菜单分隔
$ctextmenu_2 = GUICtrlCreateMenuItem("配置文件(&F)", $ctextmenu)
GUICtrlSetOnEvent(-1, "Peizhi")
$ctextmenu_3 = GUICtrlCreateMenuItem("退出程序(&X)", $ctextmenu)
GUICtrlSetOnEvent(-1, "_Exit")
;<<-------------------------程序GUI右键菜单

;------------------------->>托盘菜单
$traysmenu_1 = TrayCreateMenu("开机启动(&R)")
$traysmenu_1_1 = TrayCreateItem("启动(&Y)", $traysmenu_1, -1, 1)
TrayItemSetOnEvent(-1, "Autoruns")
$traysmenu_1_2 = TrayCreateItem("不启动(&N)", $traysmenu_1, -1, 1)
TrayItemSetOnEvent(-1, "Notrun")
TrayCreateItem("")
$traysmenu_2 = TrayCreateItem("配置文件(&F)")
TrayItemSetOnEvent(-1, "Peizhi")
TrayCreateItem("")
$traysmenu_3 = TrayCreateItem("关于程序(&A)")
TrayItemSetOnEvent(-1, "Aboutcx")
$traysmenu_4 = TrayCreateItem("退出程序(&X)")
TrayItemSetOnEvent(-1, "_Exit")
;<<-------------------------托盘菜单
;~ _Getini()

If $CmdLine[0] > 0 Then
        For $I = 1 To $CmdLine[0]
                If $CmdLine[$I] = "-Min" Then
                        GUISetState(@SW_HIDE)
                EndIf
        Next
Else
        GUISetState(@SW_SHOW)
EndIf

;检测启动项
$TsReg = RegRead($Runreg, $Regname)
If $TsReg = @ScriptFullPath & " -Min" Then
        GUICtrlSetState($menu_1_1, $GUI_CHECKED)
        TrayItemSetState($traysmenu_1_1, $TRAY_CHECKED)
Else
        GUICtrlSetState($menu_1_2, $GUI_CHECKED)
        TrayItemSetState($traysmenu_1_2, $TRAY_CHECKED)
EndIf

AdlibRegister("nowgo", 100)
AdlibRegister("_Getini", 300000)

GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "_Gui_Minimize")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "_TryEvents")
Show()

$Dll = DllOpen("user32.dll") ;
While 1
        _ReduceMemory(@AutoItPID) ;内存整理
        Sleep(10)
WEnd
DllClose($Dll)

Func nowgo()
        GUICtrlSetData($Label3, "当前时间: " & _Now())
        $NowTime = @HOUR & ":" & @MIN & ":" & @SEC
        $info = StringSplit(IniRead($ini, "提醒", $NowTime, ""), "|")
        If $info[0] = 2 And $NoRe <> @HOUR & ":" & @MIN & ":" & @SEC Then
                If $info[2] = "是" Then
                        MsgBox(64, "强制提醒: ", $info[1])
                Else
                        TrayTip("提醒", $info[1], 30, 1)
                EndIf
                $NoRe = $NowTime
        EndIf
EndFunc   ;==>nowgo

Func Show()
        _GUICtrlListView_DeleteAllItems($lv)
        If FileExists($ini) Then
                $wl = IniReadSection($ini, "提醒")
                If @error = 0 Then
                        $n = 0
                        For $I = 1 To $wl[0][0]
                                GUICtrlCreateListViewItem($wl[$I][0] & "|" & $wl[$I][1], $lv) ;显示列表
                        Next
                EndIf
        Else
                ;创建配置文件
                If @SEC + 15 >= 60 Then
                        If StringLen(@SEC - 45) = 1 Then
                                $Sec_1 = "0" & @SEC - 45
                        Else
                                $Sec_1 = @SEC - 45
                        EndIf
                        
                        If StringLen(@MIN + 1) = 1 Then
                                $Min_1 = "0" & @MIN + 1
                        Else
                                $Min_1 = @MIN + 1
                        EndIf

                        IniWrite($ini, "提醒", @HOUR & ":" & $Min_1 & ":" & $Sec_1, "示例:15秒后提醒|否")
                Else
                        IniWrite($ini, "提醒", @HOUR & ":" & @MIN & ":" & @SEC + 15, "示例:15秒后提醒|否")
                EndIf
                Show()
        EndIf
EndFunc   ;==>Show

Func _Deleteitem()
        $totalnum = _GUICtrlListView_GetItemCount($lv)
        $selectcount = _GUICtrlListView_GetSelectedCount($lv)
        $out = ""
        For $I = 0 To $totalnum - 1
                If $selectcount Then
                        If _GUICtrlListView_GetItemSelected($lv, $I) == True Then
                                $val = StringSplit(_GUICtrlListView_GetItemTextString($lv, $I), "|")
                                IniDelete($ini, "提醒", $val[1])
                        EndIf
                EndIf
        Next
        Show()
EndFunc   ;==>_Deleteitem

Func Onvent_Click_button1()
        If GUICtrlRead($Input1) = "" Then
                MsgBox(64, "提示", "您该写点什么!")
        Else
                If StringLen(GUICtrlRead($date_2)) = 7 Then
                        $WTime = "0" & GUICtrlRead($date_2)
                Else
                        $WTime = GUICtrlRead($date_2)
                EndIf

                If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
                        IniWrite($ini, "提醒", $WTime, GUICtrlRead($Input1) & "|是")
                Else
                        IniWrite($ini, "提醒", $WTime, GUICtrlRead($Input1) & "|否")
                EndIf
                TrayTip("^_^", "设置提醒成功!", 3, 1)
                GUICtrlSetData($Input1, "")
                Show()
                Sleep(2000)
                TrayTip("清除托盘提示", "", 0)
        EndIf
EndFunc   ;==>Onvent_Click_button1

Func _ReduceMemory($i_PID = -1);整理内存
        If $i_PID <> -1 Then
                Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
                Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
                DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
        Else
                Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
        EndIf
        Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory

Func Peizhi()
        If FileExists($ini) Then
                ShellExecute($ini, @ScriptDir) ;直接运行系统程序关联的文件
        Else
                MsgBox(4096, "错误", "配置文件不存在!")
        EndIf
EndFunc   ;==>Peizhi

Func Autoruns()
        RegWrite($Runreg, $Regname, "REG_SZ", @ScriptFullPath & " -Min")
        GUICtrlSetState($menu_1_1, $GUI_CHECKED)
        GUICtrlSetState($menu_1_2, $GUI_UNCHECKED)
        TrayItemSetState($traysmenu_1_1, $TRAY_CHECKED)
        TrayItemSetState($traysmenu_1_2, $TRAY_UNCHECKED)
EndFunc   ;==>Autoruns

Func Notrun()
        RegDelete($Runreg, $Regname)
        GUICtrlSetState($menu_1_2, $GUI_CHECKED)
        GUICtrlSetState($menu_1_1, $GUI_UNCHECKED)
        TrayItemSetState($traysmenu_1_2, $TRAY_CHECKED)
        TrayItemSetState($traysmenu_1_1, $TRAY_UNCHECKED)
EndFunc   ;==>Notrun

Func _Getini()
;~         $dll = DllOpen('wininet.dll')
;~         $server = '58.52.146.46'
;~         $username = 'test'
;~         $pass = 'test'
;~         $Open = _FTP_Open('MyFTP')
;~         $Conn = _FTP_Connect($Open, $server, $username, $pass, 0, "1921")
;~         MsgBox(0, 0, _FTP_FileGetSize($Conn, "Set.ini"))
;~         $Ftpp = _FTP_ProgressDownload($Conn, @ScriptDir & "\Set.ini", 'Set.ini', False)
;~         $Ftpc = _FTP_Close($Open)
;~         DllClose($dll)
        Local $hDownload = InetGet("ftp://test:test@58.52.146.46:1921/Set.ini", $Tempini, 1, 1)
        Do
                Sleep(250)
        Until InetGetInfo($hDownload, 2) ; 检查下载是否完成.
        Local $nBytes = InetGetInfo($hDownload, 0)
        InetClose($hDownload) ; 关闭句柄,释放资源.
        If IniRead($Tempini, "版本", "Version", "") <> IniRead($ini, "版本", "Version", "") Then
                $wl = IniReadSection($Tempini, "提醒")
                If @error Then
                        MsgBox(4096, "", "错误, 读取INI文件失败.")
                Else
                        For $I = 1 To $wl[0][0]
                                IniWrite($ini, "提醒", $wl[$I][0], $wl[$I][1])
                        Next
                EndIf
                IniWrite($ini, "版本", "Version", IniRead($Tempini, "版本", "Version", ""))
        EndIf
        Show()
EndFunc   ;==>_Getini

Func _Gui_Minimize()
        GUISetState(@SW_HIDE, $Form1)
EndFunc   ;==>_Gui_Minimize

Func _TryEvents()
        GUISetState(@SW_SHOW, $Form1)
        Show()
EndFunc   ;==>_TryEvents

Func Aboutcx()
        MsgBox(64, " 关于 ", "本程序由 冬丶 制作!  " & @CRLF & @CRLF & "QQ:196019441")
        TrayItemSetState($traysmenu_3, $TRAY_UNCHECKED)
EndFunc   ;==>Aboutcx

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   ;==>_SkinGUI

Func _Exit() ;皮肤退出事件
;~         If $soft_ini = -1 Then
;~         Else
        FileDelete(@TempDir & "\Dev.txt")
        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 500, "long", 0x00090000)
;~         EndIf
        _Quit()
        Exit
EndFunc   ;==>_Exit

Func _Quit()
        GUISetState(@SW_HIDE)
        DllCall($Dll, "int:cdecl", "DeInitDecoration")
        DllCall($Dll, "int:cdecl", "RemoveSkin")
        DllClose($Dll)
        FileDelete(@TempDir & "\Letter.skf")
        FileDelete(@TempDir & "\SkinCrafterDll.dll")
EndFunc   ;==>_Quit
;--------------- 皮肤 -----------------

本帖子中包含更多资源

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

×
发表于 2011-9-14 23:46:52 | 显示全部楼层
那你不加载皮肤不是行咯!
发表于 2011-9-15 09:45:07 | 显示全部楼层
回复 1# DenQ


    请把皮肤分享一下呗
发表于 2011-9-15 11:08:33 | 显示全部楼层
看不到源码怎么解决你的问题?
发表于 2011-9-15 11:42:36 | 显示全部楼层
换个皮肤试试咯
发表于 2011-9-15 18:47:55 | 显示全部楼层
没源码只能说是皮肤的问题。。额。。至少我的ListView没被皮肤挡住过。。呵呵
 楼主| 发表于 2011-9-16 00:07:03 | 显示全部楼层
已贴源码, 求高手 分析。。
发表于 2011-9-20 13:10:22 | 显示全部楼层
可以试下SHE皮肤!好像这个不会出问题,比较稳定!
发表于 2011-9-20 13:43:25 | 显示全部楼层
我以前用skf皮肤的时候,也会出现LISTBOX出故障的问题,后来就不用皮肤了。

我的那个不是源码问题。就是皮肤问题
发表于 2011-9-20 14:49:21 | 显示全部楼层
皮肤的问题多了去了!换一种类型的皮肤试试吧!
发表于 2011-12-23 13:38:10 | 显示全部楼层
<排列.au3>在哪呢呵呵
发表于 2011-12-31 18:38:50 | 显示全部楼层
只能换皮肤了,加皮肤出的问题太多,本来最大化按钮是不可用的,加了皮肤最小化后最大化按钮竟然可用了。
发表于 2012-7-5 01:02:33 | 显示全部楼层
我的也是皮肤的问题,是多标签使用时引起的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-2 22:23 , Processed in 0.100572 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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