How can I use more than 4 Cases in a Switch statement for creating a DLL Icons viewer in AutoHotkey?

41 Views Asked by At

How to have a Hotkey Switch use more than 4 Cases?

I am trying to create a script that takes advantage of the way the Switch - Case commands work. At the moment I have it working with Cases 1-4, but I cannot figure out how to go above that and I need it to cycle through 25 Cases for a DLL viewer I'm trying to put together. I believe it's the math of the Switch command, but I do not understand it enough. This is what I have so far. Thank you to any able to help me figure this out.

^T:: 
Switch ++N := 0 N & 3    ; N = 1,2,3,4,1...
{
    Case 1: 
DllPath := "C:\WINDOWS\SYSTEM32\accessibilitycpl.dll"
Gui, Margin, 0, 0
Gui, +AlwaysOnTop -MinimizeBox -DPIScale +hwndGuiHwnd
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", GuiHwnd, "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui, Add, Button, w300 h50 gIconSizeToggle +Center, Toggle Icon Size
Gui, Add, ListView, w300 h550 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, ACCESSIBILITYCPL
DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Gui Show, h600 w300, Dll icons
Return
    Case 2: 
DllPath := "C:\WINDOWS\SYSTEM32\compstui.dll"
Gui, Margin, 0, 0
Gui, +AlwaysOnTop -MinimizeBox -DPIScale +hwndGuiHwnd
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", GuiHwnd, "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui, Add, Button, w300 h50 gIconSizeToggle +Center, Toggle Icon Size
Gui, Add, ListView, w300 h550 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, COMPSTUI.DLL
DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0) 
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Gui Show, h600 w300, Dll icons
Return
    Case 3: 
DllPath := "C:\WINDOWS\SYSTEM32\comres.dll"
Gui, Margin, 0, 0
Gui, +AlwaysOnTop -MinimizeBox -DPIScale +hwndGuiHwnd
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", GuiHwnd, "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui, Add, Button, w300 h50 gIconSizeToggle +Center, Toggle Icon Size
Gui, Add, ListView, w300 h550 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, COMRES.DLL
DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Gui Show, h600 w300, Dll icons
Return
    Case 4: 
DllPath := "C:\WINDOWS\SYSTEM32\ddores.dll"
Gui, Margin, 0, 0
Gui, +AlwaysOnTop -MinimizeBox -DPIScale +hwndGuiHwnd
DllCall("uxtheme\SetWindowThemeAttribute", "ptr", GuiHwnd, "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui, Add, Button, w300 h50 gIconSizeToggle +Center, Toggle Icon Size
Gui, Add, ListView, w300 h550 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, DDORES.DLL
DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Gui Show, h600 w300, Dll icons
}
Return

IconSizeToggle:
IconSize := !IconSize
GuiControl, -Redraw, ListView
LV_Delete()
if (IconSize)
    ImageListID := IL_Create(1, 1, 1)
else
    ImageListID := IL_Create()
LV_SetImageList(ImageListID, 1)

Loop { ; Populate the listview
    Check := IL_Add(ImageListID, DllPath, A_Index)
    if (Check != 0) {
        LV_Add("Icon" . A_Index, A_Index)
    }
    else
        Break
}
GuiControl, +Redraw, ListView
Return
1

There are 1 best solutions below

0
V0RT3X On

I was able to figure this out. The full script is below. I would love if someone who actually knows what they are doing could edit this so the icon size only toggles when hitting the 'Toggle Icon Size' button rather than alternating every hotkey press. Otherwise, I think this is pretty much done...displays DLL/EXE names as headers, icons, and their corresponding numbers.

/*
; ╞═══════════ Pre-Notes ═══════════╡ 
» Ctrl + T -  : Cycles through various SYSTEM32 .dll and .exe files and extracts their icons and icon number.

» Refresh Script ════  Ctrl + HOME key rapidly clicked 2 times. (# TapCounts)
» Exit Script ════════  Ctrl + Escape key rapidly clicked 3 times. (# TapCounts)

» Script Updater: Auto-reload script upon saved changes.
    ─ If you make any changes to the script file and save it, the script will automatically reload itself and continue running without manual intervention.

» IndicateDots :  Visual/audio indicators displaying small colored dot just above tray clock and producing a soundbeep, indicating/verifying actions being taken.
; ╞──────── Pre-Notes End ────────╡ 
*/

; ╞═══════════ Auto-Execute ═══════════╡ 
Gosub, AutoExecute
; ╞──────── Auto-Execute End ────────╡ 

; ╞═══════════ Hotkey ═══════════╡ 
^T::     ; ═════ (Ctrl + T) 
  Gosub, IndicateDot1
Gui, Color, LIME         ; ←←← IndicateDot Color.
  Gosub, IndicateDot2

; ╞────────  Hotkey End ────────╡ 

; ▎░░░░░░░▏ The Code ▏░░░░░░░▎ 

; ╞═══════════ Pre-Gui ═══════════╡ 
Gui, Color, 71B0DA  ; Soft Blue
Gui, Font, s12 w400 c0000A7  ; Deep Blue
Gui, Margin, 5, 5
Gui, 
    +AlwaysOnTop 
;    -Caption 
    -DPIScale 
    +hwndGuiHwnd
    -MinimizeBox 
    +Owner

    DllCall("uxtheme\SetWindowThemeAttribute", "ptr", GuiHwnd, "int", 1, "int64*", 6 | 6<<32, "uint", 8)
Gui, Add, Button, w170 h50 gIconSizeToggle +Center, ◈ Toggle Icon Size ◈
Gui, Add, Button, x+29 w100 h50 gRESET +Center, Restart`n↺  Script  ↻
; ╞────────  Pre-Gui End ────────╡ 

    Switch n := n++ - max ? n : 1
{
    Case 1: 
DllPath := "C:\WINDOWS\SYSTEM32\accessibilitycpl.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, ACCESSIBILITYCPL.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 2: 
DllPath := "C:\WINDOWS\SYSTEM32\compstui.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, COMPSTUI.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 3: 
DllPath := "C:\WINDOWS\SYSTEM32\comres.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, COMRES.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 4: 
DllPath := "C:\WINDOWS\SYSTEM32\ddores.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, DDORES.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 5: 
DllPath := "C:\WINDOWS\SYSTEM32\dmdskres.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, DMDSKRES.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 6: 
DllPath := "C:\WINDOWS\SYSTEM32\dsuiext.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, DSUIEXT.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 7: 
DllPath := "C:\WINDOWS\explorer.exe"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, EXPLORER.EXE
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 8: 
DllPath := "C:\WINDOWS\SYSTEM32\ieframe.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, IEFRAME.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 9: 
DllPath := "C:\WINDOWS\SYSTEM32\imageres.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, IMAGERES.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 10: 
DllPath := "C:\WINDOWS\SYSTEM32\mmcndmgr.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, MMCNDMGR.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 11: 
DllPath := "C:\WINDOWS\system32\mmres.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, MMRES.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 12: 
DllPath := "C:\WINDOWS\SYSTEM32\moricons.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, MORICONS.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 13: 
DllPath := "C:\WINDOWS\SYSTEM32\mstsc.exe"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, MSTSC.EXE
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 14: 
DllPath := "C:\WINDOWS\SYSTEM32\mstscax.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, MSTSCAX.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 15: 
DllPath := "C:\WINDOWS\SYSTEM32\netcenter.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, NETCENTER.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 16: 
DllPath := "C:\WINDOWS\SYSTEM32\netshell.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, NETSHELL.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 17: 
DllPath := "C:\WINDOWS\SYSTEM32\networkexplorer.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, NETWORKEXPLORER.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 18: 
DllPath := "C:\WINDOWS\system32\pifmgr.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, PIFMGR.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 19: 
DllPath := "C:\WINDOWS\SYSTEM32\pnidui.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, PNIDUI.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 20: 
DllPath := "C:\WINDOWS\SYSTEM32\sensorscpl.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, SENSORSCPL.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 21: 
DllPath := "C:\WINDOWS\SYSTEM32\setupapi.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, SETUPAPI.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 22: 
DllPath := "C:\WINDOWS\SYSTEM32\shell32.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, SHELL32.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 23: 
DllPath := "C:\WINDOWS\SYSTEM32\wiashext.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, WIASHEXT.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 24: 
DllPath := "C:\WINDOWS\SYSTEM32\wmploc.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, WMPLOC.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 25: 
DllPath := "C:\WINDOWS\SYSTEM32\wpdshext.dll"
Gui, Add, ListView, x5 w300 h550 BackgroundE1E2E3 vListView +hwndListViewHwnd -0x4000 +LV0x10000 +0x8000, WPDSHEXT.DLL
    DllCall("UxTheme.dll\SetWindowTheme", "Ptr", ListViewHwnd, "WStr", "Explorer", "Ptr", 0)
LV_ModifyCol(1,279)
GoSub, IconSizeToggle
Return

    Case 26: 
RELOAD       ; Reload script to start from cycle beginning.

}
Return

; ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 
  IconSizeToggle:
IconSize := !IconSize
GuiControl, -Redraw, ListView
LV_Delete()
if (IconSize)
    ImageListID := IL_Create(1, 1, 1)
else
    ImageListID := IL_Create()
LV_SetImageList(ImageListID, 1)
Loop {
    Check := IL_Add(ImageListID, DllPath, A_Index)
    if (Check != 0) {
        LV_Add("Icon" . A_Index, A_Index)
    }
    else
        Break
}
; ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 

GuiControl, +Redraw, ListView
Gui, Show, x%xval% y%yval%           ; ←←← h600 w300,
OnMessage(0x0201, "WM_LBUTTONDOWN")      ; ←←← Gui drag capability Pt. 1. after (Gui, Show).
Return

WM_LBUTTONDOWN() {           ; ←←← Gui drag capability Pt. 2. towards script end.
   PostMessage, 0x00A1, 2, 0
}

GuiClose: 
    Reload

; ▎░░░░░░░▏ The Code End ▏░░░░░░░▎ 

; ╞═══════════ Reload/Exit Routine ═══════════╡ 
RETURN

; ◦ ◦ ◦ ◦ ◦ ◦ ◦ RELOAD  SCRIPT ◦ ◦ ◦ ◦ ◦ ◦ ◦ 

^Home::           ; ←←← (Ctrl + ([Home Button] x (# of TapCounts)))
if (A_TimeSincePriorHotkey > 250) 
{
    TapCount := 1
    KeyWait, Esc
} else {
    TapCount++
    if (TapCount = 2)    ; ←←← Set TapCount to # of key taps wanted.
    {
  Gosub, IndicateDot1
Gui, Color, YELLOW       ; ←←← IndicateDot Color.
  Gosub, IndicateDot2
        Reload
} else {
        KeyWait, Esc
    }
}
Return

; ◦ ◦ ◦ ◦ ◦ ◦ ◦ EXIT SCRIPT ◦ ◦ ◦ ◦ ◦ ◦ ◦ 

^Esc::      ; ←←← (Ctrl + ([Esc] x (# of TapCounts)))
if (A_TimeSincePriorHotkey > 250) 
{
    TapCount := 1
    KeyWait, Esc
} else {
    TapCount++
    if (TapCount = 3)    ; ←←← Set TapCount to # of key taps wanted.
    {
  Gosub, IndicateDot1
Gui, Color, RED          ; ←←← IndicateDot Color.
  Gosub, IndicateDot2
        Gui, Destroy
        ExitApp
} else {
        KeyWait, Esc
    }
}
Return

; ╞──────── Reload/Exit Routine End ────────╡ 

; ╞═══════════ Script Updater ═══════════╡ 
UpdateCheck:                 ; Check if the script file has been modified.
    oldModTime := currentModTime
FileGetTime, currentModTime, %A_ScriptFullPath%
; ◦ ◦ ◦ ◦ ◦ ◦ If the modification timestamp has changed, reload the script.
    if  (oldModTime = currentModTime) Or (oldModTime = "")
        Return
  Gosub, IndicateDot1
Gui, Color, BLUE         ; ←←← IndicateDot Color.
  Gosub, IndicateDot2
Reload

; ╞──────── Script Updater End ────────╡ 


; ╞═══════════ Auto-Execute GoSub ═══════════╡ 
  AutoExecute:
#SingleInstance, Force
#Persistent
SetBatchLines -1
DetectHiddenWindows, On
SetTimer, UpdateCheck, 500 ; Checks for script changes every 1/2 second. (Script Updater)
SetKeyDelay, 250 ; ←←← Set the tap delay time (milliseconds) for script Exit. (Tied to Reload/Exit routine)
Menu, Tray, Icon, wmploc.dll, 99 ; Local White Star tray Icon.
max := 26 
xval:=A_ScreenWidth-320      ; # of pixels from 
yval:=A_ScreenHeight-687     ; # of pixels from 
Return
; ╞──────── Auto-Execute Sub End ────────╡ 

; ╞═══════════ GoSubs ═══════════╡ 

RESET:
    Reload
  IndicateDot1:
Gui, Destroy
SysGet, MonitorWorkArea, MonitorWorkArea
SysGet, TaskbarPos, 4
Gui, +AlwaysOnTop -Caption +hwndHGUI +LastFound
Return

; ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ 

  IndicateDot2:
Gui, Margin, 13, 13          ; ←←← Dot Size.
Gui, Show, Hide
WinGetPos, , , WinWidth, WinHeight, ahk_id %HGUI%
NewX := MonitorWorkAreaRight - 80
NewY := MonitorWorkAreaBottom - WinHeight - 5
R := Min(WinWidth, WinHeight) // 1   ; ←←← Set value of cornering. (0.5=Oval, 0=square, 1= round, 5=rounded corners).
WinSet, Region, 0-0 W%WinWidth% H%WinHeight% R%R%-%R%
Gui, Show, x%NewX% y%NewY%
SoundGet, master_volume
SoundSet, 7
Soundbeep, 2100, 100
SoundSet, % master_volume
Sleep, 500
Gui, Destroy
Return

; ╞──────── GoSubs End ────────╡ 

; ╞──────────────────────────╡ 
; ╞═══════════ Script End ═══════════╡ 
; ╞──────────────────────────╡