Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 907

Community Plugins & Addons • desktop-detector

$
0
0
Detect Desktop - Show Desktop Detector for Windows

Overview
This lightweight tool detects when the Windows desktop becomes the foreground window, and determines whether it was due to the "Show Desktop" action (e.g., Win+D or taskbar corner). It’s ideal for automation, logging, or developing tools that respond to desktop visibility.

Features
  • Detects when desktop comes to the foreground or returns to background.
  • Differentiates between manual desktop focus and "Show Desktop" actions.
  • Logs with timestamps to console or file.
  • Lightweight and efficient (uses WinEvent hooks).
  • Command-line options for logging and quiet mode.
How It Works
  1. Monitors system events:
    • EVENT_SYSTEM_FOREGROUND - when the foreground window changes.
    • EVENT_SYSTEM_MINIMIZESTART - when a window starts minimizing.
  2. If any window minimizes within 1 second before the desktop becomes foreground, it treats it as a "Show Desktop" action.
  3. Logs the result accordingly.
Usage

Code:

detect-desktop.exe [--quiet] [--log] [--help]
Options
  • --quiet : Suppress console output.
  • --log : Append output to detect-desktop.log.
  • --help : Show help and usage information.
Example

Code:

detect-desktop.exe --log
Sample Output

Code:

[2025-05-24 10:30:12] Initial state: Desktop is BACKGROUND[2025-05-24 10:30:12] Listening for Show Desktop; press Ctrl+C to exit.[2025-05-24 10:30:18] *** Desktop is now FOREGROUND (Show Desktop)[2025-05-24 10:31:05] *** Desktop is now BACKGROUND (apps shown)
Notes
  • The "Show Desktop" detection is based on minimize bursts and may give false positives in rare edge cases.
  • This is a console-based tool. Run it from Command Prompt or integrate it into your scripts.
  • Press Ctrl+C to exit the program.
Tool Download
detect-desktop-v1.1.rar

Statistics: Posted by nstechbytes — Today, 12:32 pm — Replies 0 — Views 127



Viewing all articles
Browse latest Browse all 907

Trending Articles