| 1 | //go:build windows |
| 2 | // +build windows |
| 3 | |
| 4 | package edge |
| 5 | |
| 6 | import ( |
| 7 | "github.com/wailsapp/go-webview2/internal/w32" |
| 8 | "golang.org/x/sys/windows" |
| 9 | "unsafe" |
| 10 | ) |
| 11 | |
| 12 | func (e *Chromium) SetSize(bounds w32.Rect) { |
| 13 | if e.controller == nil { |
| 14 | return |
| 15 | } |
| 16 | |
| 17 | hr, _, _ := e.controller.vtbl.PutBounds.Call( |
| 18 | uintptr(unsafe.Pointer(e.controller)), |
| 19 | uintptr(bounds.Left), |
| 20 | uintptr(bounds.Top), |
| 21 | uintptr(bounds.Right), |
| 22 | uintptr(bounds.Bottom), |
| 23 | ) |
| 24 | |
| 25 | if windows.Handle(hr) != windows.S_OK { |
| 26 | e.errorCallback(windows.Errno(hr)) |
| 27 | } |
| 28 | } |
| 29 |