Skip to content

Commit b09ac90

Browse files
committed
Add SetBkColor
1 parent 938414c commit b09ac90

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gdi32.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ var (
10091009
resetDC uintptr
10101010
restoreDC uintptr
10111011
selectObject uintptr
1012+
setBkColor uintptr
10121013
setBkMode uintptr
10131014
setBrushOrgEx uintptr
10141015
setPixel uintptr
@@ -1070,6 +1071,7 @@ func init() {
10701071
restoreDC = MustGetProcAddress(libgdi32, "RestoreDC")
10711072
saveDC = MustGetProcAddress(libgdi32, "SaveDC")
10721073
selectObject = MustGetProcAddress(libgdi32, "SelectObject")
1074+
setBkColor = MustGetProcAddress(libgdi32, "SetBkColor")
10731075
setBkMode = MustGetProcAddress(libgdi32, "SetBkMode")
10741076
setBrushOrgEx = MustGetProcAddress(libgdi32, "SetBrushOrgEx")
10751077
setPixel = MustGetProcAddress(libgdi32, "SetPixel")
@@ -1499,6 +1501,15 @@ func SelectObject(hdc HDC, hgdiobj HGDIOBJ) HGDIOBJ {
14991501
return HGDIOBJ(ret)
15001502
}
15011503

1504+
func SetBkColor(hdc HDC, crColor COLORREF) COLORREF {
1505+
ret, _, _ := syscall.Syscall(setBkColor, 2,
1506+
uintptr(hdc),
1507+
uintptr(crColor),
1508+
0)
1509+
1510+
return COLORREF(ret)
1511+
}
1512+
15021513
func SetBkMode(hdc HDC, iBkMode int32) int32 {
15031514
ret, _, _ := syscall.Syscall(setBkMode, 2,
15041515
uintptr(hdc),

0 commit comments

Comments
 (0)