• 欢迎访问奇跡の海网站,本站不上传任何资源,所有资源均来自于网络,欢迎加入奇跡の海~!奇跡の海-WordPress QQ群
  • 本站下载资源为网络上收集整理而来,并且以计算机技术研究交流为目的,版权归原作者所有,仅供大家参考,学习,不存在任何商业目的与商业用途.
  • 本站系统镜像均来自于官方原版,ed2k可视为P2P下载链接。所有操作系统默认均为试用版,如有正版密钥可以有效激活,本站不提供任何激活和相关服务。

AutoIt3(au3)源码-菜单代码

AutoIT3 奇跡の海 1年前 (2017-11-08) 331次浏览 已收录 0个评论 扫描二维码

代码简介

菜单代码MINI菜单,横排,竖排
AutoIt3(au3)源码-菜单代码

AU3源码

竖排

#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=D:\autoit3\Aut2Exe\Icons\favicon.ico
#PRE_Outfile=MINI菜单.exe
#PRE_Compression=4
#PRE_Res_Comment=MINI菜单
#PRE_Res_Description=MINI菜单
#PRE_Res_Fileversion=1.0.0.0
#PRE_Res_LegalCopyright=by MINI菜单
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <GuiImageList.au3>
If Not FileExists("menu.ini") Then
IniWrite("menu.ini","title","title","软件菜单")
IniWrite("menu.ini","command","菜单名称1","路径1")
IniWrite("menu.ini","command","菜单名称2","路径2")
IniWrite("menu.ini","command","菜单名称3","路径3")
IniWrite("menu.ini","command","菜单名称4","路径4")
IniWrite("menu.ini","command","以此类推","有多少写多少,最多不超20个为宜")
EndIf
Global $Form
Opt("GUIOnEventMode", 1)
$Command = IniReadSection("menu.ini", "command")
$title=IniRead("menu.ini","title","title","")
$height2=$Command[0][0]*45
$Form1 = GUICreate($title, 150, $height2+20, -1, -1,BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
For $I = 1 To $Command[0][0]
    $Command[$i][0] = GUICtrlCreateButton($Command[$i][0], 16, 16+($i-1)*45, 123, 40)
        $img= _GUIImageList_Create(32, 32, 5, 1, 0)
    _GUIImageList_AddIcon($img, $Command[$I][1], 0, True)
    _GUICtrlButton_SetImageList(-1, $img)
        GUICtrlSetOnEvent($Command[$I][0], "Command")
Next
;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00080000)
GUISetState()
While 1
    Sleep(1000)
WEnd
Func Command()
    For $i = 1 To UBound($Command, 1) - 1
               If @GUI_CtrlId = $Command[$I][0] Then Run($Command[$I][1],StringLeft ( $Command[$I][1], StringInStr($Command[$I][1], "\",0,-1)))
    Next
   _exit()
EndFunc
Func _Exit()
    ;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00090000);渐隐
;DllCall($dll, "int:cdecl", "DeInitDecoration")
    ;DllCall($dll, "int:cdecl", "RemoveSkin")
    ;DllClose($dll)
    ;FileDelete(@TempDir&"\SkinCrafterDll.dll")
    ;FileDelete(@TempDir&"\skin.skf")
        Exit
EndFunc

横排

#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=D:\autoit3\Aut2Exe\Icons\favicon.ico
#PRE_Outfile=MINI菜单.exe
#PRE_Compression=4
#PRE_Res_Comment=MINI菜单
#PRE_Res_Description=MINI菜单
#PRE_Res_Fileversion=1.0.0.0
#PRE_Res_LegalCopyright=by MINI菜单
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <GuiImageList.au3>
If Not FileExists("menu.ini") Then
IniWrite("menu.ini","title","title","软件菜单")
IniWrite("menu.ini","command","菜单名称1","路径1")
IniWrite("menu.ini","command","菜单名称2","路径2")
IniWrite("menu.ini","command","菜单名称3","路径3")
IniWrite("menu.ini","command","菜单名称4","路径4")
IniWrite("menu.ini","command","以此类推","有多少写多少,最多不超12个为宜")
EndIf
Global $Form
Opt("GUIOnEventMode", 1)
$Command = IniReadSection("menu.ini", "command")
$title=IniRead("menu.ini","title","title","")
$chang=$Command[0][0]*140
$Form1 = GUICreate($title, $chang+20, 65, -1, -1,BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
For $I = 1 To $Command[0][0]
    $Command[$i][0] = GUICtrlCreateButton($Command[$i][0], 16+($i-1)*140, 16, 123, 40)
        $img= _GUIImageList_Create(32, 32, 5, 1, 0)
    _GUIImageList_AddIcon($img, $Command[$I][1], 0, True)
    _GUICtrlButton_SetImageList(-1, $img)
        GUICtrlSetOnEvent($Command[$I][0], "Command")
Next
;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00080000)
GUISetState()
While 1
    Sleep(1000)
WEnd
Func Command()
    For $i = 1 To UBound($Command, 1) - 1
               If @GUI_CtrlId = $Command[$I][0] Then Run($Command[$I][1],StringLeft ( $Command[$I][1], StringInStr($Command[$I][1], "\",0,-1)))
    Next
   _exit()
EndFunc
Func _Exit()
    ;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00090000);渐隐
;DllCall($dll, "int:cdecl", "DeInitDecoration")
    ;DllCall($dll, "int:cdecl", "RemoveSkin")
    ;DllClose($dll)
    ;FileDelete(@TempDir&"\SkinCrafterDll.dll")
    ;FileDelete(@TempDir&"\skin.skf")
        Exit
EndFunc

版权声明:本站所有文章和资源使用CC BY-NC-SA 4.0协议授权发布 , 转载应当以相同方式注明文章来自“SeaOMC.COM->AutoIt3(au3)源码-菜单代码!在下边可以分享本文哦!
喜欢 (0)
[]
分享 (0)
奇跡の海
关于作者:
一个WordPress菜鸟!
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址