-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.go
More file actions
57 lines (47 loc) · 1.54 KB
/
Copy pathinit.go
File metadata and controls
57 lines (47 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"flag"
"log"
"os"
"golang.org/x/sys/windows"
)
type HANDLE uintptr
type HWND HANDLE
const zeroHandle = HWND(0)
var (
// Library
libuser32 *windows.LazyDLL
setWindowCompositionAttribute *windows.LazyProc
messageBox *windows.LazyProc
findWindow *windows.LazyProc
findWindowEx *windows.LazyProc
registerWindowMessage *windows.LazyProc
FLAG_ACCENT int
)
func init() {
log.SetFlags(log.Lmicroseconds | log.Lshortfile) // https://ispycode.com/GO/Logging/Setting-output-flags
// Library
libuser32 = windows.NewLazySystemDLL("user32.dll")
setWindowCompositionAttribute = libuser32.NewProc("SetWindowCompositionAttribute")
messageBox = libuser32.NewProc("MessageBoxW")
findWindow = libuser32.NewProc("FindWindowW")
findWindowEx = libuser32.NewProc("FindWindowExW")
registerWindowMessage = libuser32.NewProc("RegisterWindowMessageW")
flag.IntVar(&FLAG_ACCENT, "accent", 0, `1 Default value. Background is black.
2 Background is GradientColor, alpha channel ignored.
3 Background is GradientColor.
4 Background is GradientColor, with blur effect.
5 Background is GradientColor, with acrylic blur effect.
6 Unknown.
7 Unknown. Seems to draw background fully transparent.`)
flag.Parse()
if len(os.Args) < 2 {
result := MsgBox("Transparent Taskbar", "Change Taskbar style to Transparent?", MB_ICONQUESTION|MB_YESNO)
switch result {
case 6:
FLAG_ACCENT = ACCENT_ENABLE_TRANSPARENT
default:
FLAG_ACCENT = ACCENT_ENABLE_GRADIENT
}
}
}