Skip to content

Instantly share code, notes, and snippets.

@fehC
fehC / cmd_scriptCMD
Last active August 29, 2015 14:17
Get raw command-line that was passed to script, including quotes
cmd_scriptCMD()
{
for process in ComObjGet("winmgmts:").ExecQuery( "Select * from Win32_Process where ProcessId=" DllCall( "GetCurrentProcessId" ) )
commandLine := process[ "commandLine" ]
SplitPath, a_scriptfullPath, scriptName
script_name_start_pos := instr( commandLine, scriptName )
script_name_length := strLen( scriptName )
isFirstCharQuote := subStr( commandLine, 1, 1 ) = """" ? 1 : 0
commandLine := trim( subStr( commandLine, script_name_start_pos+script_name_length+isFirstCharQuote ) )
return commandLine
@fehC
fehC / process.ahk
Last active January 3, 2016 05:59
Process-related functions
/*
Credit to Wanker
author : Chef
link : http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55319
date : 14 January 2014
description
Process-related functions
@fehC
fehC / tray.ahk
Created January 1, 2014 10:01
Tray-related functions
#noEnv
#persistent
#singleInstance force
detectHiddenWindows, on
setWorkingDir %a_scriptDir%
/*
Created by Sean
http://www.autohotkey.com/board/topic/15918-extract-informations-about-trayicons/
/*
mwa := monitorWorkingArea()
msgBox, % mwa.x " " mwa.y " " mwa.w " " mwa.h
exitApp
*/
monitorWorkingArea()
{
/*
author : Chef
@fehC
fehC / process.ahk
Last active December 31, 2015 14:49
Process-related functions
/*
Credit to Wanker
author : Chef
link : http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55319
date : 14 January 2014
description
process-related functions