-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
8,522 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: benwa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.exe | ||
*.bgi | ||
*.vbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
;@Ahk2Exe-SetCopyright Bennett Blodinger | ||
;@Ahk2Exe-SetDescription Quality of life improvements for Sysinternal's BgInfo | ||
;@Ahk2Exe-SetLanguage 0x0409 | ||
;@Ahk2Exe-SetName BgInfo-Helper | ||
;@Ahk2Exe-SetVersion 1.0.0 | ||
|
||
;@Ahk2Exe-IgnoreBegin | ||
#Warn | ||
;@Ahk2Exe-IgnoreEnd | ||
/*@Ahk2Exe-Keep | ||
#NoTrayIcon | ||
ListLines Off | ||
*/ | ||
#NoEnv | ||
#Persistent | ||
#SingleInstance, Force | ||
|
||
Process, Priority, , Low | ||
|
||
#Include, %A_ScriptDir%\Lib\Gdip_All.ahk | ||
|
||
global executable, global parameters | ||
|
||
; Get bitness | ||
if (A_Is64bitOS) { | ||
executable := "BgInfo64.exe" | ||
} else { | ||
executable := "BgInfo.exe" | ||
} | ||
|
||
; Parse arguments | ||
For Each, argument In A_Args { | ||
parameters .= (parameters <> "" ? A_Space : "") . argument | ||
} | ||
|
||
; Convert unsupported image formats | ||
ConvertWallpaper(format:="bmp") { | ||
RegRead, currentWallpaper, HKEY_CURRENT_USER\Control Panel\Desktop, WallPaper | ||
SplitPath, currentWallpaper, currentWallpaper_outFileName, currentWallpaper_outDir, currentWallpaper_outExtension, currentWallpaper_outNameNoExt, currentWallpaper_outDrive | ||
StringUpper, currentWallpaper_outExtension, currentWallpaper_outExtension | ||
If (!RegExMatch(currentWallpaper_outExtension, "^(?i:BMP|JPG|GIF)$")) { | ||
If (pToken0 := Gdip_Startup()) { | ||
convertedWallpaper := A_Temp . "\" . currentWallpaper_outNameNoExt . "." . format | ||
pBitmap0 := Gdip_CreateBitmapFromFile(currentWallpaper) | ||
Gdip_SaveBitmapToFile(pBitmap0, convertedWallpaper) | ||
Gdip_DisposeImage(pBitmap0) | ||
Gdip_Shutdown(pToken0) | ||
} | ||
DllCall("SystemParametersInfo", Int, 0x14, Int, 0, Str, convertedWallpaper, Int, 3) | ||
} | ||
} | ||
|
||
; Refresh BgInfo at startup | ||
WM_DISPLAYCHANGE(0, 0) | ||
|
||
; Listen for resolution changes | ||
OnMessage(0x7E, "WM_DISPLAYCHANGE") | ||
|
||
WM_DISPLAYCHANGE(wParam, lParam) { | ||
ConvertWallpaper("bmp") | ||
Run, %executable% %parameters% | ||
DllCall("SetProcessWorkingSetSize", Int, -1, Int, -1, Int, -1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [1.0.0] - 2020-12-15 | ||
### Added | ||
- Initial release | ||
- Refresh on resolution changes | ||
- Convert wallpaper to supported format | ||
|
||
[Unreleased]: compare/v1.0.0...HEAD | ||
[1.0.0]: releases/tag/v1.0.0 |
Oops, something went wrong.