下面是测试代码,是我哪里弄错了,请高手指教,谢谢。
```go
package main
import (
"github.com/lxn/walk"
"github.com/lxn/walk/declarative"
"github.com/lxn/win"
)
func main() {
form := new(walk.MainWindow)
declarative.MainWindow{
AssignTo: &form,
Title: "test",
Size: declarative.Size{300, 300},
}.Create()
setFormStyle(form)
form.Run()
}
func setFormStyle(form *walk.MainWindow) {
// 设置窗口样式
style := win.GetWindowLong(form.Handle(), win.GWL_STYLE)
style = style | win.WS_EX_TOOLWINDOW
win.SetWindowLong(form.Handle(), win.GWL_STYLE, style)
}
```
谢谢您的解答,可是测试仍然无效,代码:
```go
func setFormStyle(form *walk.MainWindow) {
// 设置窗口样式
style := win.GetWindowLongPtr(form.Handle(), win.GWL_EXSTYLE)
style = style | win.WS_EX_TOOLWINDOW
win.SetWindowLongPtr(form.Handle(), win.GWL_EXSTYLE, style)
}
```
#4