-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
7,459 additions
and
1,707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,56 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
#NoTrayIcon | ||
#Persistent | ||
#SingleInstance force | ||
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory. | ||
#SingleInstance | ||
Persistent | ||
|
||
global script | ||
|
||
/* Setup Tray icon and add item that will handle | ||
* double click events | ||
*/ | ||
Menu Tray, NoStandard | ||
Menu Tray, Icon | ||
Menu Tray, Icon, SpmImageTycoon.ico | ||
Menu Tray, Add, Show / Hide, TrayClick | ||
Menu Tray, Add, Close, CloseItem | ||
Menu Tray, Default, Show / Hide | ||
; Setup Tray icon and add item that will handle double click events | ||
Tray:= A_TrayMenu | ||
Tray.Delete() | ||
TraySetIcon("SpmImageTycoon.ico") | ||
Tray.Add("Show / Hide", TrayClick) | ||
Tray.Add("Close", CloseItem) | ||
Tray.Default := "Show / Hide" | ||
|
||
;// Run program or batch file hidden | ||
DetectHiddenWindows On | ||
Run SpmImageTycoon.bat,, Hide, PID | ||
WinWait ahk_pid %PID% | ||
DetectHiddenWindows(true) | ||
Run("SpmImageTycoon.bat", , "Hide", &PID) | ||
ErrorLevel := WinWait("ahk_pid " PID) , ErrorLevel := ErrorLevel = 0 ? 1 : 0 | ||
script := WinExist() | ||
DetectHiddenWindows Off | ||
DetectHiddenWindows(false) | ||
|
||
SetTimer, Closer, 2000 | ||
SetTimer(Closer, 2000) | ||
|
||
return | ||
|
||
TrayClick: | ||
OnTrayClick() | ||
return | ||
TrayClick(A_ThisMenuItem, A_ThisMenuItemPos, MyMenu) { | ||
OnTrayClick() | ||
return | ||
} | ||
|
||
;// Show / hide program or batch file on double click | ||
OnTrayClick() { | ||
OnTrayClick(*) { | ||
if DllCall("IsWindowVisible", "Ptr", script) { | ||
WinHide ahk_id %script% | ||
|
||
WinHide("ahk_id " script) | ||
} else { | ||
WinShow ahk_id %script% | ||
WinActivate ahk_id %script% | ||
WinShow("ahk_id " script) | ||
WinActivate("ahk_id " script) | ||
} | ||
} | ||
|
||
CloseItem() { | ||
CloseItem(*) { | ||
DetectHiddenWindows(true) | ||
ErrorLevel := WinWait("ahk_class ConsoleWindowClass") , ErrorLevel := ErrorLevel = 0 ? 1 : 0 | ||
ErrorLevel := ProcessClose("cmd.exe") | ||
DetectHiddenWindows(false) | ||
ExitApp() | ||
} | ||
|
||
DetectHiddenWindows On | ||
WinWait ahk_class ConsoleWindowClass | ||
Process, Close, cmd.exe | ||
DetectHiddenWindows Off | ||
ExitApp | ||
|
||
Closer(*) { | ||
ErrorLevel := ProcessExist(PID) | ||
If !ErrorLevel | ||
ExitApp() | ||
Return | ||
} | ||
|
||
|
||
Closer: | ||
Process, Exist, %PID% | ||
If !ErrorLevel | ||
ExitApp | ||
Return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
julia -t auto -e "using SpmImageTycoon; tycoon();" | ||
timeout /t 60 | ||
timeout /t 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
#NoTrayIcon | ||
#Persistent | ||
#SingleInstance force | ||
|
||
global script | ||
|
||
/* Setup Tray icon and add item that will handle | ||
* double click events | ||
*/ | ||
Menu Tray, NoStandard | ||
Menu Tray, Icon | ||
Menu Tray, Icon, SpmImageTycoon.ico | ||
Menu Tray, Add, Show / Hide, TrayClick | ||
Menu Tray, Add, Close, CloseItem | ||
Menu Tray, Default, Show / Hide | ||
|
||
;// Run program or batch file hidden | ||
DetectHiddenWindows On | ||
Run SpmImageTycoon.bat,, Hide, PID | ||
WinWait ahk_pid %PID% | ||
script := WinExist() | ||
DetectHiddenWindows Off | ||
|
||
SetTimer, Closer, 2000 | ||
|
||
return | ||
|
||
TrayClick: | ||
OnTrayClick() | ||
return | ||
|
||
;// Show / hide program or batch file on double click | ||
OnTrayClick() { | ||
if DllCall("IsWindowVisible", "Ptr", script) { | ||
WinHide ahk_id %script% | ||
|
||
} else { | ||
WinShow ahk_id %script% | ||
WinActivate ahk_id %script% | ||
} | ||
} | ||
|
||
CloseItem() { | ||
|
||
DetectHiddenWindows On | ||
WinWait ahk_class ConsoleWindowClass | ||
Process, Close, cmd.exe | ||
DetectHiddenWindows Off | ||
ExitApp | ||
|
||
} | ||
|
||
|
||
Closer: | ||
Process, Exist, %PID% | ||
If !ErrorLevel | ||
ExitApp | ||
Return |
Oops, something went wrong.