Skip to content

Instantly share code, notes, and snippets.

@RaptorX
RaptorX / radio.ahk
Created October 18, 2024 22:16
Capture radio button name on click
#Requires AutoHotkey v2
#SingleInstance force
myGui := Gui()
myGui.OnEvent("Close", GuiClose)
myGui.Add("Radio", "vSDK", "SDK").OnEvent("Click", ShowText)
myGui.Add("Radio","vChannel yp", "Channel Review").OnEvent("Click", ShowText)
myGui.Add("Radio","vEmail yp", "Email").OnEvent("Click", ShowText)
myGui.show()
Return
txt := inputhook("v")
::test::
{
txt.tacker := "test"
SendInput 'default --string '
txt.start()
}
::test2::
txt := inputhook("v")
::test::
tracker := "test"
SendInput % "default --string "
txt.start()
return
settimer displayCursor, 10
return
displayCursor()
{
if a_cursor = 'IBeam'
{
MouseGetPos ,,, &OutputVarControl, 2
hwnd := ControlGetFocus('A')
if (OutputVarControl = hwnd)
$F14::
$F13::
$F15::
; Separate the modifier keys(Ctrl, Alt, Shift) from the hotkey(F4,F6...)
RegexMatch(a_thishotkey, "O)^\$(?<mod>[\^+!#]+)?(?<key>.*)$", matched)
mod := matched.mod
key := matched.key
; Translate certain hotkeys to something ProgramName can understand
gui add, button, hwndBtnOK w32 h32, %a_space%
gui add, button, hwndBtnCancel w75, Cancel
okIcon := LoadPicture("C:\Windows\system32\shell32.dll", "w16 h16 Icon" 297, imgType)
cancelIcon := LoadPicture("C:\Windows\system32\shell32.dll", "w16 h16 Icon" 132, imgType)
SendMessage 0xf7, 1, %okIcon%,, ahk_id %BtnOK%
SendMessage 0xf7, 1, %cancelIcon%,, ahk_id %BtnCancel%
gui show
return
;******************************************************************************
; Want a clear path for learning AutoHotkey? *
; Take a look at our AutoHotkey GUI Udemy courses at: *
; https://the-automator.com/GUIs?src=f *
; *
; They're structured in a way to make learning AHK EASY *
; Right now you can get a coupon code here: https://the-Automator.com/Learn *
;******************************************************************************
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
@RaptorX
RaptorX / CBRB Example
Created March 25, 2022 16:05
Quick example of how to use Checkboxes and Radio buttons
gui add, edit, w100 vName
gui add, radio, vRBTitle, Mr.
gui add, radio,, Mrs.
gui add, radio,, Dr.
gui add, checkbox, vCBTrouble,Troubleshoot
gui add, checkbox, vCBCall,Call
gui add, button, w75 gShowVars, Create Message
gui show