Skip to content

Instantly share code, notes, and snippets.

@tmplinshi
tmplinshi / FixIE.ahk
Created January 17, 2016 23:26 — forked from G33kDude/FixIE.ahk
Force embedded IE (shell.explorer) to use a better render engine
FixIE(Version=0, ExeName="")
{
static Key := "Software\Microsoft\Internet Explorer"
. "\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
, Versions := {7:7000, 8:8888, 9:9999, 10:10001, 11:11001}
if Versions.HasKey(Version)
Version := Versions[Version]
if !ExeName
; AutoHotkey_L:
IEGet(name="") {
IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame ; Get active window if no parameter
Name := (Name="New Tab - Windows Internet Explorer")? "about:Tabs":RegExReplace(Name, " - (Windows|Microsoft) Internet Explorer")
for WB in ComObjCreate("Shell.Application").Windows
if WB.LocationName=Name and InStr(WB.FullName, "iexplore.exe")
return WB
}
WM_KEYDOWN = 0x100
GoSub, GetHTML
OnMessage(WM_KEYDOWN, "WM_KeyDown")
Gui Add, ActiveX, w350 h300 x0 y0 vdoc, HTMLFile
doc.write(html)
Gui, Show, w310 h265 Center, HTML Based GUI
doc.all.type.focus
ComObjConnect(doc, "Doc_")
return
SetTitleMatchMode 2
MsgBox % Acc_Get("Value", "4.20.2.4.2", 0, "Firefox")
MsgBox % Acc_Get("Value", "application1.property_page1.tool_bar2.combo_box1.editable_text1", 0, "Firefox")
Acc_Get(Cmd, ChildPath="", ChildID=0, WinTitle="", WinText="", ExcludeTitle="", ExcludeText="") {
static properties := {Action:"DefaultAction", DoAction:"DoDefaultAction", Keyboard:"KeyboardShortcut"}
#Persistent
Small := 32
Medium := 48
Large := 96
IconSize := Small
hDesktop := GetDesktop()
HalfW := A_ScreenWidth/2
; -------------------------------------------------------------------------------
; 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
;
@tmplinshi
tmplinshi / GDI.ahk
Last active August 29, 2015 14:12 — forked from G33kDude/GDI.ahk
class GDI
{
__New(hWnd, CliWidth=0, CliHeight=0)
{
if !(CliWidth && CliHeight)
{
VarSetCapacity(Rect, 16, 0)
DllCall("GetClientRect", "Ptr", hWnd, "Ptr", &Rect)
CliWidth := NumGet(Rect, 8, "Int")
CliHeight := NumGet(Rect, 12, "Int")
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
{
; Image2Include.ahk
#SingleInstance Off
; ======================================================================================================================
; Function: Creates AHK #Include files for images providing a function which will internally create a bitmap/icon.
; AHK version: 1.1.10.01 (U32)
; Script version: 1.0.00.02/2013-06-02/just me - added support for icons (HICON)
; 1.0.00.01/2013-05-18/just me - fixed bug producing invalid function names
; 1.0.00.00/2013-04-30/just me