@@ -30,7 +30,8 @@ const (
3030 wsThickFrame = 0x00040000
3131 wsMinimizeBox = 0x00020000
3232 wsMaximizeBox = 0x00010000
33- hwndTopMost = ^ uintptr (0 ) // (HWND)-1 == HWND_TOPMOST
33+ hwndTopMost = ^ uintptr (0 ) // (HWND)-1 == HWND_TOPMOST (unused, kept for reference)
34+ hwndBottom = uintptr (1 ) // (HWND)1 == HWND_BOTTOM — behind all other windows
3435 swpNoSize = 0x0001
3536 swpNoMove = 0x0002
3637 swpNoActivate = 0x0010
@@ -73,8 +74,8 @@ func applyToolWindowStyle(title string) {
7374 newExStyle := (exStyle | wsExToolWindow ) &^ wsExAppWindow
7475 procSetWindowLongW .Call (hwnd , gwlExStyle , newExStyle )
7576
76- // 3. Set HWND_TOPMOST and force frame refresh with SWP_FRAMECHANGED .
77- procSetWindowPos .Call (hwnd , hwndTopMost , 0 , 0 , 0 , 0 ,
77+ // 3. Set HWND_BOTTOM (behind all other windows) and force frame refresh.
78+ procSetWindowPos .Call (hwnd , hwndBottom , 0 , 0 , 0 , 0 ,
7879 swpNoMove | swpNoSize | swpNoActivate | swpShowWindow | swpFrameChanged )
7980}
8081
@@ -96,7 +97,7 @@ func moveWindow(_ fyne.Window, x, y int) {
9697 return
9798 }
9899 // SetWindowPos with SWP_NOSIZE to move without resizing.
99- procSetWindowPos .Call (hwnd , hwndTopMost ,
100+ procSetWindowPos .Call (hwnd , hwndBottom ,
100101 uintptr (x ), uintptr (y ), 0 , 0 ,
101102 swpNoSize | swpNoActivate )
102103}
0 commit comments