A Windows shell extension to mark files with a 'watched' icon, and a utility program to automatically mark things as watched by polling the recently played list of VLC media player.
Note: This is mostly to scratch my own itch, and to learn a bit about using COM from Zig. I have no real plans for this becoming anything more generally useful.
- Download the .zip file from Releases
- Unzip to wherever you'd like
- Run the
install.bat
as Administrator (right click -> Run as administrator) - Restart
explorer.exe
, or log out/log back in, or restart your computer
- Download the new version
- Run the
uninstall.bat
of your existing version as Administrator (right click -> Run as administrator) - Restart
explorer.exe
, or log out/log back in, or restart your computer - Overwrite your existing version's files with the new version's files
- Run the
install.bat
as Administrator (right click -> Run as administrator) - Restart
explorer.exe
, or log out/log back in, or restart your computer
Note: Last tested with Zig 0.14.0-dev.673+390c7d84b
. Pull requests that fix the build for latest master version of Zig are always welcome.
zig build dist
- The resulting files will be in
zig-out/dist
Note that, by default, zig build dist
will build everything in debug mode and use all the features of your current CPU (so it may not work on other computers). To make a more portable and faster build, you can use something like zig build dist -Doptimize=ReleaseSafe -Dcpu=x86_64
instead. If targeting versions of Windows older than 8, then -Dsingle-threaded
should be used to avoid a dependency on RtlWaitOnAddress
.
- dllmain.zig has the dll entry point and exports
DllGetClassObject
, which is used to provideIClassFactory
s for our registeredCLSID
s. Also exportsDllRegisterServer
/DllUnregisterServer
for integration withregsvr32
- factory.zig has our
IClassFactory
implementation, which is used to allocate our registeredIShellIconOverlayIdentifier
andIContextMenu
implementations - overlay.zig has our
IShellIconOverlayIdentifier
implementation, which is used to determine which items to put an icon overlay on - context_menu.zig has our
IContextMenu
implementation, which is used to add our menu item to the right click context menu - db.zig provides an interface to the sqlite database that stores which filepaths are marked as 'watched'
- watcher-vlc.zig implements the polling of the VLC recently played files list and automatically marks things as watched
- com.zig, windows_extra.zig, and registry.zig provide bindings and helpers for various Windows APIs.
- COM in plain C to learn about how to work with COM from C
- The Complete Idiot's Guide to Writing Shell Extensions and apriorit/IconOverlayHandler for an example of how custom icon overlays/context menu entries can be added (with C++)
- marlersoft/zigwin32 and michal-z/zig-gamedev for examples of how to create bindings for COM interfaces from Zig