{"id":30207618,"url":"https://github.com/nstechbytes/wallpaper-addon","last_synced_at":"2025-08-13T16:11:58.201Z","repository":{"id":306572128,"uuid":"1026627786","full_name":"NSTechBytes/wallpaper-addon","owner":"NSTechBytes","description":"Native addon to set windows behind desktop icons on Windows","archived":false,"fork":false,"pushed_at":"2025-07-26T09:22:07.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-26T15:28:08.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NSTechBytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-26T09:19:11.000Z","updated_at":"2025-07-26T09:21:03.000Z","dependencies_parsed_at":"2025-07-26T15:28:15.293Z","dependency_job_id":"d47f2eba-6a22-49a4-844f-78809488b8d3","html_url":"https://github.com/NSTechBytes/wallpaper-addon","commit_stats":null,"previous_names":["nstechbytes/wallpaper-addon"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/NSTechBytes/wallpaper-addon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2Fwallpaper-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2Fwallpaper-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2Fwallpaper-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2Fwallpaper-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSTechBytes","download_url":"https://codeload.github.com/NSTechBytes/wallpaper-addon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2Fwallpaper-addon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270270288,"owners_count":24555781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-13T16:11:52.487Z","updated_at":"2025-08-13T16:11:58.116Z","avatar_url":"https://github.com/NSTechBytes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wallpaper-addon\n\nA Node.js native addon for Windows that allows you to set windows behind desktop icons, effectively creating live wallpapers or desktop overlays.\n\n## Features\n\n- Set any window behind desktop icons (as wallpaper)\n- Get the WorkerW window handle\n- Restore windows from behind desktop\n- Validate window handles\n- Uses the same proven logic as your original C++ implementation\n\n## Prerequisites\n\n- Windows operating system\n- Node.js 12.0.0 or higher\n- Visual Studio Build Tools or Visual Studio with C++ development tools\n- Python (for node-gyp)\n\n## Installation\n\n```bash\nnpm install\n```\n\nThis will automatically build the native addon using node-gyp.\n\n## Usage\n\n```javascript\nconst wallpaperAddon = require('wallpaper-addon');\n\n// Get the WorkerW window handle\nconst workerHandle = wallpaperAddon.getWorkerWindow();\nconsole.log('WorkerW handle:', workerHandle);\n\n// Set a window behind desktop icons (windowHandle should be a string)\nconst windowHandle = \"123456789\"; // Replace with actual window handle\nconst success = wallpaperAddon.setWindowBehindDesktop(windowHandle);\nconsole.log('Set behind desktop:', success);\n\n// Restore window from behind desktop\nconst restored = wallpaperAddon.restoreWindow(windowHandle);\nconsole.log('Restored:', restored);\n\n// Check if window handle is valid\nconst isValid = wallpaperAddon.isValidWindow(windowHandle);\nconsole.log('Is valid window:', isValid);\n```\n\n## API Reference\n\n### `setWindowBehindDesktop(windowHandle)`\n\nSets a window behind desktop icons, making it appear as wallpaper.\n\n- **Parameters:**\n  - `windowHandle` (string): The window handle as a string\n- **Returns:** boolean - `true` if successful, `false` otherwise\n\n### `getWorkerWindow()`\n\nGets the WorkerW window handle that sits behind desktop icons.\n\n- **Returns:** string|null - The WorkerW window handle as string, or `null` if not found\n\n### `restoreWindow(windowHandle)`\n\nRestores a window from behind desktop icons back to normal window behavior.\n\n- **Parameters:**\n  - `windowHandle` (string): The window handle as a string\n- **Returns:** boolean - `true` if successful, `false` otherwise\n\n### `isValidWindow(windowHandle)`\n\nChecks if a window handle is valid and the window still exists.\n\n- **Parameters:**\n  - `windowHandle` (string): The window handle as a string\n- **Returns:** boolean - `true` if valid, `false` otherwise\n\n## How It Works\n\nThis addon uses the same logic as your original C++ code:\n\n1. **Finds the Program Manager window** (`Progman`)\n2. **Sends a special message** (0x052C) to spawn the WorkerW window behind desktop icons\n3. **Locates the WorkerW window** using enumeration callbacks\n4. **Sets the target window as a child** of WorkerW using `SetParent()`\n5. **Positions and sizes the window** to fill the desktop area\n\nThe WorkerW window is a special Windows desktop window that sits between the desktop wallpaper and desktop icons, making it perfect for live wallpapers.\n\n## Getting Window Handles\n\nTo get window handles for use with this addon, you can:\n\n1. **Use Windows Spy++ tool** (included with Visual Studio)\n2. **Use PowerShell:**\n   ```powershell\n   Get-Process | Where-Object {$_.MainWindowTitle -ne \"\"} | Select-Object ProcessName, Id, MainWindowHandle\n   ```\n3. **Use another Node.js addon** like `win32-api` or `ffi-napi` to enumerate windows\n4. **From your own applications** - most GUI frameworks provide ways to get window handles\n\n## Example with Electron\n\n```javascript\n// In your Electron main process\nconst { BrowserWindow } = require('electron');\nconst wallpaperAddon = require('wallpaper-addon');\n\n// Create window\nconst win = new BrowserWindow({\n  width: 800,\n  height: 600,\n  webPreferences: {\n    nodeIntegration: true\n  }\n});\n\n// Get window handle and set as wallpaper\nconst handle = win.getNativeWindowHandle().toString();\nwallpaperAddon.setWindowBehindDesktop(handle);\n```\n\n## Building from Source\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the addon\nnpm run build\n\n# Or rebuild\nnode-gyp rebuild\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\n## Troubleshooting\n\n1. **Build errors:** Make sure you have Visual Studio Build Tools installed\n2. **WorkerW not found:** This can happen on some Windows versions - try running as administrator\n3. **Window not appearing:** Ensure the window handle is valid and the window exists\n4. **Permission issues:** Some system windows cannot be manipulated - try with regular application windows\n\n## Platform Support\n\n- **Windows 7** and later\n- **x64 and x86** architectures supported\n- **Node.js 12.0.0+** required\n\n## License\n\nMIT License\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstechbytes%2Fwallpaper-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnstechbytes%2Fwallpaper-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstechbytes%2Fwallpaper-addon/lists"}