lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.8k stars 885 forks source link

How to achieve main windows on the top? #672

Closed singhwang closed 4 years ago

singhwang commented 4 years ago

I want to make my main window on the top. How should i develop?

singhwang commented 4 years ago

I have achieved by adding following code to window.go file. // BringToTopMost moves the WindowBase to the top most of the keyboard focus order. func (wb WindowBase) BringToTopMost() error { if !win.SetWindowPos(wb.hWnd, win.HWND_TOPMOST, 0, 0, 0, 0, win.SWP_NOACTIVATE|win.SWP_NOMOVE|win.SWP_NOSIZE) { return lastError("SetWindowPos") }

return nil

}