Skip to content

Instantly share code, notes, and snippets.

@AHK-just-me
AHK-just-me / GuiControlAddBox.ahk
Last active December 15, 2015 21:19
GuiControlAddBox (DE)
#NoEnv
SetBatchLines, -1
Gui, New
Gui, Margin, 20, 20
; Textfeld mit den Dimensionen der "GroupBox" erstellen
Gui, Add, Text, w400 h200 vGB hwndHGB BackGroundTrans Section
; Position holen, um den Titel später zentrieren zu können
GuiControlGet, GB, Pos
; "GroupBox" Rahmen im Textfeld erstellen
@AHK-just-me
AHK-just-me / Class_LV_Colors.ahk
Last active July 29, 2019 10:15
Class_LV_Colors{} - Set background and/or text colours for individual cells or rows in an AHK GUI ListView control.
; ======================================================================================================================
; Namespace: LV_Colors
; AHK version: AHK 1.1.09.02
; Function: Helper object and functions for ListView row and cell coloring
; Language: English
; Tested on: Win XPSP3, Win VistaSP2 (U32) / Win 7 (U64)
; Version: 0.1.00.00/2012-10-27/just me
; 0.2.00.00/2013-01-12/just me - bugfixes and minor changes
; 0.3.00.00/2013-06-15/just me - added "Critical, 100" to avoid drawing issues
; ======================================================================================================================
@G33kDude
G33kDude / GDI.ahk
Last active August 11, 2019 06:48
GDI wrapper for AutoHotkey
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")
@AHK-just-me
AHK-just-me / Class_CCButton.ahk
Last active August 12, 2021 15:11
Class CCButton - Colored Captions on Buttons
; ======================================================================================================================
; Namespace: CCButton
; Function: Helper class for colored captions on themed pushbuttons.
; AHK version: 1.1.09.04 (U32)
; Language: English
; Version: 1.0.00.00/2013-04-27/just me
; ======================================================================================================================
; How to use: To register a GUI pushbutton call
; CCButton.Attach()
; passing two parameters:
@TLMcode
TLMcode / GoogleServices.php
Last active February 23, 2022 16:09
Google API Service Endpoints in PHP & cURL
<?php
class GoogleServices
{
public function __construct()
{
$this->SetVariables();
$this->VerifyToken();
}
@sammbertram
sammbertram / dynwrap.js
Created June 3, 2017 09:55
RegistrationFree DynamicWrapperX
var actCtx = new ActiveXObject( "Microsoft.Windows.ActCtx" );
actCtx.Manifest = "C:\\Tools\\COM\\dynwrap.test.manifest";
try
{
var DX = actCtx.CreateObject("DynamicWrapperX");
DX.Register("user32.dll", "MessageBoxW", "i=hwwu", "r=l"); // Register a dll function.
res = DX.MessageBoxW(0, "Hello, world!", "Test", 4); // Call the function.
}
catch(e){ WScript.Echo("Fail");}
@Uberi
Uberi / Speech Recognition.ahk
Created August 18, 2013 20:29
Speech recognition with Microsoft's SAPI. A simple SpeechRecognizer class provides a quick and easy way to use speech recognition in your scripts. Inspired by some [prototype code](http://www.autohotkey.com/board/topic/24490-voice-recognition-com/) made a long time ago.
#NoEnv
#Warn All
#Warn LocalSameAsGlobal, Off
#Persistent
/*
Speech Recognition
==================
A class providing access to Microsoft's SAPI. Requires the SAPI SDK.
@qwerty12
qwerty12 / BrightnessSetter.ahk
Last active July 25, 2023 13:06
BrightnessSetter: set laptop brightness and show Windows 10's native brightness OSD (https://github.com/qwerty12/AutoHotkeyScripts/tree/master/LaptopBrightnessSetter)
class BrightnessSetter {
; qwerty12 - 27/05/17
; https://github.com/qwerty12/AutoHotkeyScripts/tree/master/LaptopBrightnessSetter
static _WM_POWERBROADCAST := 0x218, _osdHwnd := 0, hPowrprofMod := DllCall("LoadLibrary", "Str", "powrprof.dll", "Ptr")
__New() {
if (BrightnessSetter.IsOnAc(AC))
this._AC := AC
if ((this.pwrAcNotifyHandle := DllCall("RegisterPowerSettingNotification", "Ptr", A_ScriptHwnd, "Ptr", BrightnessSetter._GUID_ACDC_POWER_SOURCE(), "UInt", DEVICE_NOTIFY_WINDOW_HANDLE := 0x00000000, "Ptr"))) ; Sadly the callback passed to *PowerSettingRegister*Notification runs on a new threadl
OnMessage(this._WM_POWERBROADCAST, ((this.pwrBroadcastFunc := ObjBindMethod(this, "_On_WM_POWERBROADCAST"))))
@AHK-just-me
AHK-just-me / Image2Include.ahk
Last active July 31, 2023 19:12
Create include files from images which can be used without external files.
; ======================================================================================================================
; 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
; Credits: Bitmap creation is based on "How to convert Image data (JPEG/PNG/GIF) to hBITMAP?" by SKAN ->
; http://www.autohotkey.com/board/topic/21213-how-to-convert-image-data-jpegpnggif-to-hbitmap/?p=139257
; ======================================================================================================================
; This software is provided 'as-is', without any express or implied warranty.
@clemensg
clemensg / curl_libuv_example.c
Last active November 2, 2023 01:48
An example on how to use libuv with libcurl's multi interface Should be equally fast on Unixes (uses epoll/kqueue/etc like libev/libevent) but MUCH faster on Windows due to libuv's usage of IO completion ports. Could come in handy if you have to manage several hundreds or thousands of connections!
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
#include <curl/curl.h>
uv_loop_t *loop;
CURLM *curl_handle;
uv_timer_t timeout;
typedef struct curl_context_s {