Add Screenshot Path to Clipboard mod#4708
Conversation
Watches %USERPROFILE%\Pictures\Screenshots and copies the full path of each new .png screenshot to the clipboard as soon as it appears.
The metadata line is plain text, not a C string, so the escaped double backslash never matched real explorer.exe paths and the mod was never injected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. The mod is small and clean, but it's injecting into 1. This should be a "mods as tools" mod, not injected into The mod doesn't hook anything — it only uses
Please convert it: change 2. Global
The standard fix is to give the global a trivial destructor — use a static std::thread* g_monitorThread = nullptr;
// ...
g_monitorThread = new std::thread(MonitorThread, folderPath);
// ...
// in uninit, after SetEvent:
if (g_monitorThread) {
g_monitorThread->join();
delete g_monitorThread;
g_monitorThread = nullptr;
}Converting to a tool mod (item 1) reduces the exposure because 3. Resolve the Screenshots folder via The default screenshots location is a real known folder and is frequently relocated — most commonly by OneDrive, which redirects the Pictures (and Screenshots) folder to PWSTR path = nullptr;
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Screenshots, 0, nullptr, &path))) {
std::wstring folderPath = path;
CoTaskMemFree(path);
// ...
}(needs Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations about the feature behavior itself.
|
Summary
Adds a new mod,
screenshot-path-to-clipboard, that watches%USERPROFILE%\Pictures\Screenshotsand copies the full path of each new.pngscreenshot to the clipboard as soon as it appears (Win+PrintScreen, Snipping Tool, Xbox Game Bar, etc.).Details
explorer.exe, usesReadDirectoryChangesWon a background thread (no polling).Changelog
N/A (new mod).
Mod authorship
This mod was created by:
Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.