AutoHotkey标签导致Windows Server 2008上的内存泄漏崩溃

时间:2013-02-14 14:29:15

标签: autohotkey

以下代码在Windows Vista和Windows 7上运行良好,但是当我尝试在Windows Server 2008 R2上运行它时,它会在我的系统托盘中产生越来越多相同脚本的实例,直到最后AutoHotKey锁定我的整个系统。似乎AutoHotKey的“标签”功能应该受到指责。有没有人知道一种解决方法?

phpDoc:
SendInput <{?}php{Enter}{Enter}{?}>{Enter}
SendInput {Up 2}
return

html5:
SendInput <{!}doctype html>{enter}
SendInput <html>{enter}
SendInput <head>{enter}
SendInput <title></title>{enter}
SendInput <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">{enter}
SendInput <meta http-equiv="Pragma" content="no-cache">{enter}
SendInput <meta http-equiv="Cache-Control" content="no-cache">{enter}
SendInput <meta name="Expires" content="Mon, 01 Jan 2000 00:00:01 GMT ">{enter}
SendInput <link rel="stylesheet" type="text/css" href="/styles.css">{enter}
SendInput </head>{enter}
SendInput <body>{enter}
SendInput </body>{enter}
SendInput </html>{enter}
SendInput {up 2}
SendInput {end}
return

showMainMenus()
{
    Menu, MySubMenu, add, &1 - PHP, phpDoc
    Menu, MySubMenu, add, &2 - HTML 5, html5
    Menu, MyMenu, add, &1 - Boilerplate Text, :MySubMenu
}

;;;; KEY BINDINGS

!/::
showMainMenus()
return

2 个答案:

答案 0 :(得分:1)

使用#SingleInstance,忽略

将保持旧实例运行并阻止启动同一脚本的新实例。

答案 1 :(得分:1)

我重写了一点。据我所知,您首先定义菜单结构,然后显示菜单。此外,由于Return之前没有phpDoc:,因此该部分脚本在启动时立即执行....

#SingleInstance, Ignore

;;;; DEFINE MENUS
Menu, MySubMenu, add, &1 - PHP, phpDoc
Menu, MySubMenu, add, &2 - HTML 5, html5

;;;; LAUNCH MENU
!/::Menu, MySubMenu, Show

return ; To prevent phpDoc from executing on startup

phpDoc:
SendInput <{?}php{Enter}{Enter}{?}>{Enter}
SendInput {Up 2}
Return

html5:
SendInput <{!}doctype html>{enter}
SendInput <html>{enter}
SendInput <head>{enter}
SendInput <title></title>{enter}
SendInput <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">{enter}
SendInput <meta http-equiv="Pragma" content="no-cache">{enter}
SendInput <meta http-equiv="Cache-Control" content="no-cache">{enter}
SendInput <meta name="Expires" content="Mon, 01 Jan 2000 00:00:01 GMT ">{enter}
SendInput <link rel="stylesheet" type="text/css" href="/styles.css">{enter}
SendInput </head>{enter}
SendInput <body>{enter}
SendInput </body>{enter}
SendInput </html>{enter}
SendInput {up 2}
SendInput {end}
return