Skip to content

Instantly share code, notes, and snippets.

#c::cmdHere()
cmdHere() {
If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class ExploreWClass")
WinGetText, data
Run, cmd, % RegExMatch(data, "i`am)^地址: \K.*", dir) ? dir : A_Desktop
}
/*
cmdHere() {
/*
ObjRegisterActive(Object, CLSID, Flags:=0)
Registers an object as the active object for a given class ID.
Requires AutoHotkey v1.1.17+; may crash earlier versions.
Object:
Any AutoHotkey object.
CLSID:
A GUID or ProgID of your own making.
; ======================================================================================================================
; Namepace: ScrollGUI
; Function: Create a scrollable GUI as a parent for GUI windows.
; Tested with: AHK 1.1.19.02
; Tested on: Win 8.1 (x64)
; Change log: 1.0.00.00/2015-02-06/just me - initial release on ahkscript.org
; License: The Unlicense -> http://unlicense.org
; ======================================================================================================================
Class ScrollGUI {
Static Instances := []
StdOutToVar( sCmd ) { ; GAHK32 ; Modified Version : SKAN 05-Jul-2013 http://goo.gl/j8XJXY
Static StrGet := "StrGet" ; Original Author : Sean 20-Feb-2007 http://goo.gl/mxCdn
DllCall( "CreatePipe", UIntP,hPipeRead, UIntP,hPipeWrite, UInt,0, UInt,0 )
DllCall( "SetHandleInformation", UInt,hPipeWrite, UInt,1, UInt,1 )
VarSetCapacity( STARTUPINFO, 68, 0 ) ; STARTUPINFO ; http://goo.gl/fZf24
NumPut( 68, STARTUPINFO, 0 ) ; cbSize
NumPut( 0x100, STARTUPINFO, 44 ) ; dwFlags => STARTF_USESTDHANDLES = 0x100
NumPut( hPipeWrite, STARTUPINFO, 60 ) ; hStdOutput
; TrayMenu.ahk
; AHK 版本: 1.1.20.00+
TrayMenu() {
static Init := %A_ThisFunc%()
static winTitle := "ahk_pid " DllCall("GetCurrentProcessId")
If (A_ThisMenuItem = "显示/隐藏窗口") {
If WinExist(winTitle) {
winTitle := "ahk_id " WinExist()
WinHide, % winTitle
; AddClearBtnToEdit.ahk
; http://ahkscript.org/boards/viewtopic.php?f=6&t=6788
/*
Function: AddClearBtnToEdit
Add a 'clear text' button over an edit control
Version:
1.21 (2015-3-21)
- Fixed a bug: Create a resizable GUI and edit control with some initialized text, resize the GUI around, the clear text button is not there, or disappears.
1.20 (2015-3-21)
剪贴板_全角数字转半角(p*) {
; 函数内部调用
If (p.1 = "ToolTip") {
ToolTip, % p.2
fn := Func(A_ThisFunc).Bind("Remove_ToolTip")
SetTimer, %fn%, -2000
Return
}
Else If (p.1 = "Remove_ToolTip") {
; Menu_SetSysMenu.ahk
/*
__ __ __ __ __ __ __ _ __
/ /_ / /_/ /_____ _ / // /____ _/ /_ / /________________(_)___ / /_ ____ _______
/ __ \/ __/ __/ __ \(_) // // __ '/ __ \/ //_/ ___/ ___/ __/ / __ \/ __// __ \/ __/ _ \
/ / / / /_/ /_/ /_/ / / // // /_/ / / / / ,< (__ ) /__/ / / / /_/ / /__/ /_/ / / / // /
/_/ /_/\__/\__/ .___(_) // / \__,_/_/ /_/_/|_/____/\___/_/ /_/ .___/\__(_)____/_/ \__ /
/_/ /_//_/ /_/ (___/
; -------------------------------------------------------------------------------
; This script automatically disconnects and/or connects Tera Term when the
; availability of a specified USB COM port changes.
;
; CONFIGURATION: Set the com ports you want this script to monitor in the
; ProcessUSBchangeEvent function below
;
; USAGE: This script can be ran by itself or included in another script
; with this line: #Include auto_connect_teraterm_usb_com_ports.ahk
;
^!LButton::Compass(1) ; Ctrl+Alt+LButton
^+LButton::Compass(2) ; Ctrl+Shift+LButton
/* Compass
* by kon - http://ahkscript.org/boards/viewtopic.php?f=6&t=7225
* Measure angles with your mouse. Press the hotkeys and drag your mouse between two points.
* If you change the hotkeys, also change the keys GetKeyState monitors in the while-loop.
* If you have multiple monitors, adjust the static variables w and h to match your resolution.
* Parameters