Open rinetd opened 6 years ago
Hi, rinetd!
if you use lxn/walk and not directly use lxn/win, you may load the icon file and put it to window like this;
icon, iconErr := walk.Resources.Icon("foo.ico")
err := MainWindow{
AssignTo: &mainWin,
Title: "MainWindow",
Icon: icon,
(snip)
}.Create()
if you want to load icon from resources, first you have to rsrc
rsrc -arch amd64 -manifest foo.exe.manifest -ico foo.ico -o rsrc.syso
and, load it like this:
icon, iconErr := walk.Resources.Icon("3")
You can do it like this, too:
err := MainWindow{
AssignTo: &mainWin,
Title: "MainWindow",
Icon: "foo.ico",
(snip)
}.Create()
i found some code like this ,but i don't known how to use it.
SetClassLong(hwnd,GCL_HICON,(LONG)LoadIcon(hinstance, IDI_ICON ));