博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

好好学习

  bilbo.cublog.cn

关于作者
姓名:你知道
职业:IT
年龄:每年大一岁
位置:地球
个性介绍:挺笨
Email: bilbo0214@163.com
|| << >> ||
我的分类


AutoHotKey代码模板
/*
[program name] v[#].[#]
 by [author name]

[short description]
*/

/*
To Do:
¡¥¡¥¡¥¡¥¡¥¡¥
- [...]
*/

/*
Revision History
¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥¡¥
# v[#].[#] ([yyyy]-[mm]-[dd])
* initial release
*/

/*
********** Settings, Variable Declarations **********
*/

#SingleInstance Force
#NoEnv
OnExit, quit

programName = [program name] ; DEBUG: to do
programVersion = [#].[#] ; DEBUG: to do
programFullName = %programName% v%programVersion%
programAuthor = [author name] ; DEBUG: to do

/*
********** Auto-Execute Section **********
*/

; backup clipboard contents -- DEBUG: optional
clipboardBak := ClipboardAll
; process command line parameters -- DEBUG: optional
GoSub, getParams
; construct tray menu -- DEBUG: optional
GoSub, trayMenu
; end of auto-execute section
Return

/*
********** Hotkeys **********
*/

; DEBUG - note: hotkeys make the script persistent!

; [ALT]+[ESC]: terminate script
!ESC::
   Suspend ; exempt from suspension -- DEBUG: optional
   GoSub, quit
Return

/*
********** Subroutines **********
*/

; process command line parameters -- DEBUG: optional (see above)
getParams:
   If 0 > 0
   {
      Loop, %0% ; for each parameter
      {
         param := %A_Index%
         ; check for switches
         StringLeft, paramType, param, 1
         If paramType = - ; switch indicator
         {
            ; determine type of switch
            StringMid, switch, param, 2, 1
            ; switch
            If switch = x ; DEBUG: template (replace "x")
            {
               ; access value (= next parameter)
               param = % A_Index + 1
               var_x := %param% ; DEBUG: template (replace "var_x")
            }
         }
      }
   }
Return

; construct tray menu -- DEBUG: optional
trayMenu:
   ; set tray tip
   Menu, Tray, Tip, %programFullName%
   ; disable standard menu items
   Menu, Tray, NoStandard
   ; show info message
   Menu, Tray, Add, &About, about
   ; separator
   Menu, Tray, Add
   ; terminate script
   Menu, Tray, Add, &Quit, quit
Return

; show info message -- DEBUG: to do, optional
about:
   MsgBox, 64, %programFullName%,
   ( LTrim
      %programFullName%
      %A_Space%by %programAuthor%

      [short description]

      Use [ALT]+[ESC] to terminate the program.
   )
Return

; terminate script
quit:
   ; restore clipboard contents -- DEBUG: optional (see above)
   Clipboard := clipboardBak
   ; terminate script
   ExitApp
Return

/*
********** Functions **********
*/

 原文地址 http://www.autohotkey.com/forum/viewtopic.php?t=7551
发表于: 2007-10-08,修改于: 2008-05-20 21:22,已浏览771次,有评论0条 推荐 投诉


网友评论
 发表评论