go-webview2 icon indicating copy to clipboard operation
go-webview2 copied to clipboard

[Feature Request] Customize title bar icon

Open Tim-Paik opened this issue 3 years ago • 2 comments

Is there a way to customize the title bar icon? I only have one way to remove the title icon (But based on a version of my fork a long time ago) link

Tim-Paik avatar Aug 03 '21 04:08 Tim-Paik

How do you propose it would work? You'd normally need to use winres or similar asset compiler to add in the data to the binary. I've done this by using webview2 as a component and treating it as an external concern.

leaanthony avatar Sep 25 '21 01:09 leaanthony

I think it should be possible to use user32:CreateIcon to get an HICON handle for an image in-memory, then set it to the hIcon member of the WNDCLASSEX structure that is registered in Create.

Not sure what the API for this might look like, though.

jchv avatar Sep 26 '21 05:09 jchv

I believe this was fixed in #43, and can be done using NewWithOptions. You do need to embed the icon into your binary, though.

jchv avatar Sep 25 '22 01:09 jchv