Skip to content

Instantly share code, notes, and snippets.

tmplinshi

Block or report user

Report or block tmplinshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Download().ahk
Download(url, dest)
{
static oHttp := ComObjCreate("WinHttp.WinHttpRequest.5.1")
oHttp.Open("GET", url, True)
oHttp.Send()
If !oHttp.WaitForResponse(-1) ; Success = -1, Timeout = 0, No response = Empty String
Return False
if ( ComObjType(oHttp.ResponseStream) = 0xD ) ; VT_UNKNOWN = 0xD
{
View ExcelToObj.ahk
; Function: ExcelToObj
; Author: tmplinshi
; Tested On: AHK: 1.1.14.03 U32 | OS: WinXP_SP3 | Microsoft Excel: 2010
; =================================================================
; Parameters:
; ExcelFile - Path to xls/xlsx file
; ResultObj - Structure is [ [], [], ... ]
; Format - Can be "csv" (default) or "html"
ExcelToObj(ExcelFile, ByRef ResultObj, Format = "csv") {
static xlCSV := 6, xlHTML := 44
View BatMan.ahk
; http://8bitdecals.com/wp-content/uploads/2012/06/pixel-superheroes.jpeg
#SingleInstance, Force
SetBatchLines -1
PixelData=
( LTrim Join|
FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|064463|F3FFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|C9FBFF|0A88C5|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF
FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|064464|F6FFFE|FEFEFE|FFFFFF|FFFFFF|FEFEFE|CDFDFF|0B89C6|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF
FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|044564|0D8CC9|E9FFFF|FEFEFD|FEFEFD|D9FEFF|0072A9|098BC5|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF
FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|064464|0A6793|016995|016995|016B98|036998|006EA6|0A89C7|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF|FFFFFF
View IsOfficeFile.ahk
; Last update: 2014-4-23
IsOfficeFile(FileName, Extensions = "doc,docx,xls,xlsx,ppt,pptx") {
static doc := "57006f007200640044006f00630075006d0065006e0074" ; W.o.r.d.D.o.c.u.m.e.n.t
, docx := "00776F72642F" ; .word/
, xls := "0057006f0072006b0062006f006f006b00" ; .W.o.r.k.b.o.o.k.
, xlsx := "0000786C2F" ; ..xl/
, ppt := "0050006f0077006500720050006f0069006e007400200044006f00630075006d0065006e007400" ; .P.o.w.e.r.P.o.i.n.t. .D.o.c.u.m.e.n.t.
, pptx := "00007070742F" ; ..ppt/
; =======================================
View Enum_Explorer.ahk
; v1.0.0
; http://www.autohotkey.com/board/topic/105112-enum-explorer-receive-all-explorer-in-z-order/
Enum_Explorer(hWnd=0, lParam=0) {
If hWnd
{
WinGetClass, class, ahk_id %hwnd%
If class in CabinetWClass,ExploreWClass
{
array := object(lParam)
If IsObject(array[hwnd])
@tmplinshi
tmplinshi / Base64.ahk
Last active Aug 29, 2015
Base64 Encode & Decode
View Base64.ahk
Base64Encode(string) {
; js code from http://www.hcidata.info/base64.htm
static js_code := "
(LTrim
var base64s = ""ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"";
function aToB64(rawData){
var encOut = ''
var b64 = '';
var i = 0;
View getrsa.js
////base64.js
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad="=";
function hex2b64(h) {
var i;
var c;
var ret = "";
for(i = 0; i+3 <= h.length; i+=3) {
c = parseInt(h.substring(i,i+3),16);
View Acc.ahk
;------------------------------------------------------------------------------
; Acc.ahk Standard Library
; by Sean
; Updated by jethrow:
; Modified ComObjEnwrap params from (9,pacc) --> (9,pacc,1)
; Changed ComObjUnwrap to ComObjValue in order to avoid AddRef (thanks fincs)
; Added Acc_GetRoleText & Acc_GetStateText
; Added additional functions - commented below
; Removed original Acc_Children function
; last updated 2/19/2012
@tmplinshi
tmplinshi / _GuiDropFiles.ahk
Created Sep 10, 2014
响应拖拽开始、结束
View _GuiDropFiles.ahk
; http://ahkscript.org/boards/viewtopic.php?f=28&p=25564#p25564
Class GuiDropFiles
{
config(GuiHwnd, BeginLable = "", EndLable = "") {
global IDropSource, IDropTarget
VarSetCapacity(IDropSource,24,0), NumPut(&IDropSource+4,IDropSource), nParams=31132
Loop, Parse, nParams
NumPut(RegisterCallback("IDropSource","",A_LoopField,A_Index-1),IDropSource,4*A_Index)
View ProgressBar.ahk
; GLOBAL SETTINGS ===============================================================================================================
#Warn
#NoEnv
#SingleInstance Force
global WM_USER := 0x00000400
global PBM_SETMARQUEE := WM_USER + 10
global PBM_SETSTATE := WM_USER + 16
global PBS_MARQUEE := 0x00000008
You can’t perform that action at this time.