Skip to content

Commit 6f3faab

Browse files
committed
1.0.0
1 parent 882015b commit 6f3faab

File tree

6 files changed

+8522
-1
lines changed

6 files changed

+8522
-1
lines changed

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: benwa

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.exe
2+
*.bgi
3+
*.vbs

BgInfo-Helper.ahk

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
;@Ahk2Exe-SetCopyright Bennett Blodinger
2+
;@Ahk2Exe-SetDescription Quality of life improvements for Sysinternal's BgInfo
3+
;@Ahk2Exe-SetLanguage 0x0409
4+
;@Ahk2Exe-SetName BgInfo-Helper
5+
;@Ahk2Exe-SetVersion 1.0.0
6+
7+
;@Ahk2Exe-IgnoreBegin
8+
#Warn
9+
;@Ahk2Exe-IgnoreEnd
10+
/*@Ahk2Exe-Keep
11+
#NoTrayIcon
12+
ListLines Off
13+
*/
14+
#NoEnv
15+
#Persistent
16+
#SingleInstance, Force
17+
18+
Process, Priority, , Low
19+
20+
#Include, %A_ScriptDir%\Lib\Gdip_All.ahk
21+
22+
global executable, global parameters
23+
24+
; Get bitness
25+
if (A_Is64bitOS) {
26+
executable := "BgInfo64.exe"
27+
} else {
28+
executable := "BgInfo.exe"
29+
}
30+
31+
; Parse arguments
32+
For Each, argument In A_Args {
33+
parameters .= (parameters <> "" ? A_Space : "") . argument
34+
}
35+
36+
; Convert unsupported image formats
37+
ConvertWallpaper(format:="bmp") {
38+
RegRead, currentWallpaper, HKEY_CURRENT_USER\Control Panel\Desktop, WallPaper
39+
SplitPath, currentWallpaper, currentWallpaper_outFileName, currentWallpaper_outDir, currentWallpaper_outExtension, currentWallpaper_outNameNoExt, currentWallpaper_outDrive
40+
StringUpper, currentWallpaper_outExtension, currentWallpaper_outExtension
41+
If (!RegExMatch(currentWallpaper_outExtension, "^(?i:BMP|JPG|GIF)$")) {
42+
If (pToken0 := Gdip_Startup()) {
43+
convertedWallpaper := A_Temp . "\" . currentWallpaper_outNameNoExt . "." . format
44+
pBitmap0 := Gdip_CreateBitmapFromFile(currentWallpaper)
45+
Gdip_SaveBitmapToFile(pBitmap0, convertedWallpaper)
46+
Gdip_DisposeImage(pBitmap0)
47+
Gdip_Shutdown(pToken0)
48+
}
49+
DllCall("SystemParametersInfo", Int, 0x14, Int, 0, Str, convertedWallpaper, Int, 3)
50+
}
51+
}
52+
53+
; Refresh BgInfo at startup
54+
WM_DISPLAYCHANGE(0, 0)
55+
56+
; Listen for resolution changes
57+
OnMessage(0x7E, "WM_DISPLAYCHANGE")
58+
59+
WM_DISPLAYCHANGE(wParam, lParam) {
60+
ConvertWallpaper("bmp")
61+
Run, %executable% %parameters%
62+
DllCall("SetProcessWorkingSetSize", Int, -1, Int, -1, Int, -1)
63+
}

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
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).
5+
6+
## [Unreleased]
7+
8+
## [1.0.0] - 2020-12-15
9+
### Added
10+
- Initial release
11+
- Refresh on resolution changes
12+
- Convert wallpaper to supported format
13+
14+
[Unreleased]: compare/v1.0.0...HEAD
15+
[1.0.0]: releases/tag/v1.0.0

0 commit comments

Comments
 (0)