Skip to content

Windows shell extension to mark arbitrary files as 'watched'

License

Notifications You must be signed in to change notification settings

squeek502/watchedoverlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watchedoverlay

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.

Installation

  1. Download the .zip file from Releases
  2. Unzip to wherever you'd like
  3. Run the install.bat as Administrator (right click -> Run as administrator)
  4. Restart explorer.exe, or log out/log back in, or restart your computer

Upgrading

  1. Download the new version
  2. Run the uninstall.bat of your existing version as Administrator (right click -> Run as administrator)
  3. Restart explorer.exe, or log out/log back in, or restart your computer
  4. Overwrite your existing version's files with the new version's files
  5. Run the install.bat as Administrator (right click -> Run as administrator)
  6. Restart explorer.exe, or log out/log back in, or restart your computer

Building

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.

  1. zig build dist
  2. 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.

Overview of the source code

  • dllmain.zig has the dll entry point and exports DllGetClassObject, which is used to provide IClassFactorys for our registered CLSIDs. Also exports DllRegisterServer/DllUnregisterServer for integration with regsvr32
  • factory.zig has our IClassFactory implementation, which is used to allocate our registered IShellIconOverlayIdentifier and IContextMenu 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.

Resources used

About

Windows shell extension to mark arbitrary files as 'watched'

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages