File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
package w32
2
2
3
3
import (
4
- "golang.org/x/sys/windows"
5
4
"syscall"
6
5
"unicode/utf16"
7
6
"unsafe"
7
+
8
+ "golang.org/x/sys/windows"
8
9
)
9
10
10
11
var (
38
39
User32SetWindowLongPtrW = user32 .NewProc ("SetWindowLongPtrW" )
39
40
User32AdjustWindowRect = user32 .NewProc ("AdjustWindowRect" )
40
41
User32SetWindowPos = user32 .NewProc ("SetWindowPos" )
42
+ User32IsDialogMessage = user32 .NewProc ("IsDialogMessage" )
43
+ User32GetAncestor = user32 .NewProc ("GetAncestor" )
41
44
)
42
45
43
46
const (
@@ -68,6 +71,12 @@ const (
68
71
WMApp = 0x8000
69
72
)
70
73
74
+ const (
75
+ GAParent = 1
76
+ GARoot = 2
77
+ GARootOwner = 3
78
+ )
79
+
71
80
const (
72
81
GWLStyle = - 16
73
82
)
Original file line number Diff line number Diff line change @@ -298,6 +298,11 @@ func (w *webview) Run() {
298
298
} else if msg .Message == w32 .WMQuit {
299
299
return
300
300
}
301
+ r , _ , _ := w32 .User32GetAncestor .Call (uintptr (msg .Hwnd ), w32 .GARoot )
302
+ r , _ , _ = w32 .User32IsDialogMessage .Call (r , uintptr (unsafe .Pointer (& msg )))
303
+ if r != 0 {
304
+ continue
305
+ }
301
306
_ , _ , _ = w32 .User32TranslateMessage .Call (uintptr (unsafe .Pointer (& msg )))
302
307
_ , _ , _ = w32 .User32DispatchMessageW .Call (uintptr (unsafe .Pointer (& msg )))
303
308
}
You can’t perform that action at this time.
0 commit comments