Skip to content

Instantly share code, notes, and snippets.

@Chudesnov
Last active December 8, 2016 15:35
Show Gist options
  • Save Chudesnov/b86679ef0772cdcb6d81f464e0dc66e6 to your computer and use it in GitHub Desktop.
Save Chudesnov/b86679ef0772cdcb6d81f464e0dc66e6 to your computer and use it in GitHub Desktop.
Clipboardic auto-close script (to be used with "Put Icon in Tray" option)
; Clipboardic is a clipboard manager for Windows by Nir Sofer (http://nirsoft.net).
; It does have a "stay in tray" option, but does not have a "start minimized" one.
; This script, when added to Startup, waits for the Clipboardic window to appear, closes it,
; and if it doesn't appear for a given amount of seconds (should be passed to the script,
; depends on your average load time, defaults to 5), unloads itself.
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
StartTime := A_TickCount
SecondsElapsed := 0
Timeout := 5
if %0% > 0
{
Timeout := %1%
}
WinWait, Clipboardic, , (Timeout)
if ErrorLevel
{
return ; Clipboardic is already hidden or not running yet
}
else
{
WinClose ; Just send a WM_CLOSE message to the window (as if you clicked on the (x) icon)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment