Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ set(BUILD_TYPE "Debug")

add_executable(cmdtab WIN32 "src/cmdtab.c" "res/cmdtab.rc")

# Copy cmdtab.ini to build directory
add_custom_command(TARGET cmdtab POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/src/cmdtab.ini"
"$<TARGET_FILE_DIR:cmdtab>/cmdtab.ini"
COMMENT "Copying cmdtab.ini to build directory"
)

#set_property(TARGET ${PROJECT_NAME} PROPERTY
#LINK_FLAGS /MANIFESTUAC:"level='highestAvailable' uiAccess='true'"
#)
Expand Down
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cmdtab
Fast and lightweight macOS-style Alt-Tab app/window switcher replacement for Windows, written in the Lord's language, C.
Fast and lightweight macOS-style (or Windows XP style, if you want that) Alt-Tab app/window switcher replacement for Windows, written in the Lord's language, C.

![cmdtab-screenshot](https://github.com/stianhoiland/cmdtab/assets/2081712/ec5d0d61-005f-4123-b191-8d5b49d1f7db)

Expand All @@ -17,7 +17,7 @@ So, you like the way Apple does it, but you're using Windows? **cmdtab** for Win
- A hotkey to cycle apps (Chrome → Spotify → File Explorer)
- A different hotkey to cycle windows (Chrome1 → Chrome2 → Chrome3)
- Big readable app icons
- Super lightweight program (35kb)
- Super lightweight program (150kb)
- Simple, clean, clear, commented C source code (easy to change/fix/extend by you/me/everyone!)
- Lots of tiny, useful QoL features, like reverse, arrow keys & enter, cancel, restore, mouse support, wrap bump, quit app, close window, delayed show...
- So fast!
Expand All @@ -29,18 +29,19 @@ The basics of window switching are easy to understand, but why is **cmdtab** *th

- Configurable hotkey to cycle apps (default Alt-Tab)
- Configurable hotkey to cycle windows of the same app (default Alt-Tilde/Backquote)
- Setting `showAllWindows` to treat windows (not apps) as the first-class object, collapsing the two-level navigation into one (as Windows does it natively).
- Reverse direction by holding Shift
- Arrow keys are supported (selects apps in switcher)
- Enter key is supported (switches to selected window)
- ~~Mouse is supported (click an app icon to switch to that app)~~ (WIP!)
- Big readable app icons (not those tiny bewildering window previews)
- Cancel and close the switcher by pressing Escape
- Smart key capture so key presses don't unexpectedly bleed through to other apps
- Wrap bump is hard to explain but easy to feel: Try holding Alt-Tab until the end, then press Tab again—works in reverse, too!
- Press Q to quit the selected app
- Press W to close the selected window
- Wrap bump makes autorepeat stop on the last icon. Very handy!
- Press Q to quit the selected app, W to close the selected window
- Option to return to the initial window when cancelling switcher by pressing Escape. This doesn't override or block Windows' native Alt-Escape hotkey
- Press F4 while the switcher is open to quit **cmdtab**
- Change appearance and behavior by editing `cmdtab.ini` in the same directory as the executable (example to be found in the code tree)

That's a lot of useful stuff, and the code is small! Go read it, and learn some C while you're at it.

Expand Down Expand Up @@ -72,3 +73,51 @@ These instructions require `git`, `cmake`, and *Visual Studio* or *MSBuild*.
5. *(in developer console)* `devenv build\cmdtab.sln /build "MinSizeRel|x64"`
6. or: *(in developer console)* `msbuild build\cmdtab.sln /property:Configuration=MinSizeRel`
7. *(run cmdtab)* `build\MinSizeRel\cmdtab.exe`

## Release history

#### 1.6.1 (2025-10-02)

- `KeyboardHookProcedure`: fix: activated window no longer receives an AltUp key event

#### 1.6.0 (2025-09-26)

- `showAllWindows` setting: show windows (not apps) at the top level
- `rowLength` setting: show the resulting longer lists of icons in multiple rows
- `showAllTitles` setting: show abbreviated titles of all apps (or windows) and full title of selected one
- `cmdtab.ini` file: read config settings from file in the executable's directory

#### 1.5.1 (2024-12-12)

- fix bug causing cmdtab to stop remembering new window activations
- fix crash when invoked with 0 windows
- change icon to vibrant blue to suit both light and dark themes
- ensure msgbox gets kbd focus

#### 1.5.0 (2024-12-11)

- first proper version: new build system CMake, instructions in README.md
- add resource info to cmdtab.exe
- cmdtab.exe has a new (placeholder) icon
- fix crash caused by some apps' product name (#2)
- dark mode and accent color awareness
- don't ShowWindow if already foreground
- extensive logging
- massive memory usage reduction
- persistent window activation order
- improve error handling of access failure on getting filepath
- fix text alignment bug caused by not #including math.h
- fix text alignment bias from right to left
- fix stuck modifier keys
- fix alt key / window menu inconsistency compared to Windows Alt-Tab
- impl Alt-Q to quit process
- rely on switcher being top-most window vs. active window

#### 1.0 (some time in 2024)

There was no formal 1.0 release (nor a 1.1, 1.2, 1.3, or 1.4).
Which of the versions to consider 1.0 is a matter of opinion.

#### 0.1 (some time in 2023)

Initially, cmdtab was only an idea. Then it grew and evolved.
8 changes: 4 additions & 4 deletions res/cmdtab.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1 VERSIONINFO
FILEVERSION 1,5,1,0
PRODUCTVERSION 1,5,1,0
FILEVERSION 1,6,1,0
PRODUCTVERSION 1,6,1,0
FILEFLAGSMASK 0x3FL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -22,14 +22,14 @@
VALUE "Comments", "N/A"
VALUE "CompanyName", "Stian Gudmundsen Høiland"
VALUE "FileDescription", "macOS-style Alt-Tab window switcher alternative"
VALUE "FileVersion", "1.5.1"
VALUE "FileVersion", "1.6.1"
VALUE "InternalName", "cmdtab"
VALUE "LegalCopyright", "Copyright (C) 2023 Stian Gudmundsen Høiland"
VALUE "LegalTrademarks", "N/A"
VALUE "OriginalFilename", "cmdtab.exe"
VALUE "PrivateBuild"; "N/A"
VALUE "ProductName", "cmdtab"
VALUE "ProductVersion", "1.5.1"
VALUE "ProductVersion", "1.6.1"
VALUE "SpecialBuild", "N/A"
}
}
Expand Down
Loading