;PasteBinPost.ahk ; Press Win+S to post your clipboard contents to PasteBin.com and return the URL ;Skrommel @2006 #SingleInstance,Force #NoEnv SetBatchLines,-1 AutoTrim,Off applicationname=PasteBinPost Gosub,INIREAD Gosub,TRAYMENU Hotkey,%hotkey%,POST If startdisabled=1 Gosub,SWAP Return POST: TrayTip,%applicationname%,Posting to %url%... SetFormat,Integer,Hex in:=Clipboard out= Loop,Parse,in { Transform,char,Asc,%A_LoopField% StringRight,char,char,2 out=%out%`%%char% } StringReplace,out,out,x,0,All StringReplace,runpost,post,,%out% SetFormat,Integer,Dec httpQueryOps:="storeHeader" httpQueryDwFlags:=(INTERNET_FLAG_NO_AUTO_REDIRECT:=0x00200000) html= length:=httpQuery(html,url,runpost) VarSetCapacity(html,-1) location:=HttpQueryHeader StringGetPos,pos,location,Location: StringTrimLeft,location,location,% pos+10 StringGetPos,pos,location,Transfer-Encoding: StringLeft,location,location,% pos-1 Gui,Add,Edit,w300,%location% Gui,Add,Button,w75 GCOPY,&Copy Gui,Add,Button,x+5 w75 GVISIT,&Visit Gui,Show,,%applicationname% - 1 Hour Software TrayTip, Return COPY: Gui,Submit Clipboard=%location% Gosub,GuiClose Return VISIT: Gui,Submit Clipboard=%location% Run,%Clipboard% Gosub,GuiClose Return GuiClose: Gui,Destroy Return TRAYMENU: Menu,Tray,NoStandard Menu,Tray,DeleteAll Menu,Tray,Add,%applicationname%,SWAP Menu,Tray,Add, Menu,Tray,Add,&Enabled,SWAP Menu,Tray,Add, Menu,Tray,Add,&Settings...,SETTINGS Menu,Tray,Add,&About...,ABOUT Menu,Tray,Add,E&xit,EXIT Menu,Tray,Check,&Enabled Menu,Tray,Default,%applicationname% Menu,Tray,Tip,%applicationname% Return SWAP: Menu,Tray,ToggleCheck,&Enabled Suspend,Toggle Return INIREAD: IfNotExist,%applicationname%.ini { activemonitor=1 startdisabled=0 hotkey=#s url=http://pastebin.com post=parent_pid=&format=text&code2=&poster=&paste=Send&expiry=m&email= Gosub,INIWRITE } IniRead,url,%applicationname%.ini,Settings,url IniRead,post,%applicationname%.ini,Settings,post IniRead,startdisabled,%applicationname%.ini,Settings,startdisabled IniRead,hotkey,%applicationname%.ini,Settings,hotkey Return INIWRITE: IniWrite,%url%,%applicationname%.ini,Settings,url IniWrite,%post%,%applicationname%.ini,Settings,post IniWrite,%startdisabled%,%applicationname%.ini,Settings,startdisabled IniWrite,%hotkey%,%applicationname%.ini,Settings,hotkey Return SETTINGS: HotKey,%hotkey%,Off Gui,Destroy Gui,Add,GroupBox,xm ym w320 h100,&Post Gui,Add,Edit,xm+10 yp+20 w300 r1 Vvurl,%url% Gui,Add,Edit,xm+10 y+5 w300 r2 Vvpost,%post% Gui,Add,GroupBox,xm y+30 w320 h50,Startup Gui,Add,Checkbox,xp+10 yp+20 Checked%startdisabled% Vvstartdisabled,&Start disabled Gui,Add,GroupBox,xm y+30 w320 h70,&Hotkey Gui,Add,Hotkey,xp+10 yp+20 w200 vvhotkey StringReplace,current,hotkey,+,Shift +%A_Space% StringReplace,current,current,^,Ctrl +%A_Space% StringReplace,current,current,!,Alt +%A_Space% StringReplace,current,current,#,Win +%A_Space% Gui,Add,Text,xm+20 y+5,Current hotkey: %current% Gui,Add,Button,xm y+20 w75 Default GSETTINGSOK,&OK Gui,Add,Button,x+5 w75 GSETTINGSCANCEL,&Cancel Gui,Show,,%applicationname% Settings Return SETTINGSOK: Gui,Submit startdisabled:=vstartdisabled If vhotkey<> { hotkey:=vhotkey HotKey,%hotkey%,POST HotKey,%hotkey%,On } If vurl<> url:=vurl If vpost<> post:=vpost Gosub,INIWRITE SysGet,monitor,Monitor,%activemonitor% Return SETTINGSCANCEL: HotKey,%hotkey%,POST HotKey,%hotkey%,On Gui,Destroy Return ABOUT: Gui,99:Destroy Gui,99:Margin,20,20 Gui,99:Add,Picture,xm Icon1,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,%applicationname% v2.0 Gui,99:Font Gui,99:Add,Text,y+10,Post you clipboard contents to PasteBin.com and return the URL Gui,99:Add,Text,y+10,- Press Win+S to post. Gui,99:Add,Text,y+10,- Change the settings using Settings in the tray menu. Gui,99:Add,Picture,xm y+20 Icon5,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,1 Hour Software by Skrommel Gui,99:Font Gui,99:Add,Text,y+10,For more tools, information and donations, please visit Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com Gui,99:Font Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,DonationCoder Gui,99:Font Gui,99:Add,Text,y+10,Please support the contributors at Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com Gui,99:Font Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exe Gui,99:Font,Bold Gui,99:Add,Text,x+10 yp+10,AutoHotkey Gui,99:Font Gui,99:Add,Text,y+10,This tool was made using the powerful Gui,99:Font,CBlue Underline Gui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com Gui,99:Font Gui,99:Show,,%applicationname% About hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND OnMessage(0x200,"WM_MOUSEMOVE") Return 1HOURSOFTWARE: Run,http://www.1hoursoftware.com,,UseErrorLevel Return DONATIONCODER: Run,http://www.donationcoder.com,,UseErrorLevel Return AUTOHOTKEY: Run,http://www.autohotkey.com,,UseErrorLevel Return 99GuiClose: Gui,99:Destroy OnMessage(0x200,"") DllCall("DestroyCursor","Uint",hCur) Return WM_MOUSEMOVE(wParam,lParam) { Global hCurs MouseGetPos,,,,ctrl If ctrl in Static9,Static13,Static17 DllCall("SetCursor","UInt",hCurs) Return } Return EXIT: ExitApp ;Stolen from DerRaphael at http://www.autohotkey.com/forum/topic33506.html ; httpQuery-0-3-3.ahk httpQuery(byref Result, lpszUrl, POSTDATA="", HEADERS="") { ; v0.3.3 (w) 27.07.2008 by Heresy & derRaphael / zLib-Style release ; currently the verbs showHeader, storeHeader, and updateSize are supported in httpQueryOps ; in case u need a different UserAgent, Proxy, ProxyByPass, Referrer, and AcceptType just ; specify them as global variables - mind the varname for referrer is httpQueryReferer [sic]. ; Also if any special dwFlags are needed such as INTERNET_FLAG_NO_AUTO_REDIRECT or cache ; handling this might be set using the httpQueryDwFlags variable as global global httpQueryOps, httpAgent, httpProxy, httpProxyByPass, httpQueryReferer, httpQueryAcceptType , httpQueryDwFlags ; Get any missing default Values defaultOps = (LTrim Join| httpAgent=AutoHotkeyScript|httpProxy=0|httpProxyByPass=0|INTERNET_FLAG_SECURE=0x00800000 SECURITY_FLAG_IGNORE_UNKNOWN_CA=0x00000100|SECURITY_FLAG_IGNORE_CERT_CN_INVALID=0x00001000 SECURITY_FLAG_IGNORE_CERT_DATE_INVALID=0x00002000|SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE=0x00000200 INTERNET_OPEN_TYPE_PROXY=3|INTERNET_OPEN_TYPE_DIRECT=1|INTERNET_SERVICE_HTTP=3 ) Loop,Parse,defaultOps,| { RegExMatch(A_LoopField,"(?P