2013-02-14 93 views
0

以下代碼在Windows Vista和Windows 7上正常工作,但是當我嘗試在Windows Server 2008 R2上運行它時,它會在同一腳本中產生越來越多的同一腳本實例我的系統托盤,直到最後AutoHotKey鎖定我的整個系統。看起來好像AutoHotKey的「標籤」功能是應該受到指責的。有誰知道解決方法?AutoHotkey標籤在Windows Server 2008上導致內存泄漏崩潰

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 

回答

1

我重寫了這一點。據我所知,你首先定義菜單結構,然後顯示菜單。此外,由於有在phpDoc:以前沒有Return,在啓動時立即執行腳本的這部分....

#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 
1

使用#SingleInstance,忽略

將離開舊的實例運行,並阻止啓動相同的腳本的新實例。

+0

顯然我沒有15美譽尚不必給予好評這些職位,否則我會給予好評兩個都。謝謝你們倆!羅伯特伊爾布林克,你的實現像一個魅力! – 2013-02-14 16:50:42

+0

我剛剛爲你挑選了Armin,因爲他是第一個! – 2013-02-16 09:15:07