MCPcopy
hub / github.com/lxn/walk / defaultWndProc

Function defaultWndProc

window.go:2131–2162  ·  view source on GitHub ↗
(hwnd win.HWND, msg uint32, wParam, lParam uintptr)

Source from the content-addressed store, hash-verified

2129}
2130
2131func defaultWndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) (result uintptr) {
2132 defer func() {
2133 // FIXME: Rework the panicking publisher so that we don't have to
2134 // access a private member here.
2135 if len(App().panickingPublisher.event.handlers) > 0 {
2136 var err error
2137 if x := recover(); x != nil {
2138 if e, ok := x.(error); ok {
2139 err = wrapErrorNoPanic(e)
2140 } else {
2141 err = newErrorNoPanic(fmt.Sprint(x))
2142 }
2143 }
2144 if err != nil {
2145 App().panickingPublisher.Publish(err)
2146 }
2147 }
2148 }()
2149
2150 if msg == notifyIconMessageId {
2151 return notifyIconWndProc(hwnd, msg, wParam, lParam)
2152 }
2153
2154 wi := windowFromHandle(hwnd)
2155 if wi == nil {
2156 return win.DefWindowProc(hwnd, msg, wParam, lParam)
2157 }
2158
2159 result = wi.WndProc(hwnd, msg, wParam, lParam)
2160
2161 return
2162}
2163
2164type menuer interface {
2165 Menu() *Menu

Callers

nothing calls this directly

Calls 7

AppFunction · 0.85
wrapErrorNoPanicFunction · 0.85
newErrorNoPanicFunction · 0.85
notifyIconWndProcFunction · 0.85
windowFromHandleFunction · 0.85
WndProcMethod · 0.65
PublishMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…