github.com/secoba/wails/v2@v2.6.4/internal/frontend/desktop/windows/winc/msghandlerregistry.go (about)

     1  //go:build windows
     2  
     3  /*
     4   * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
     5   * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
     6   */
     7  
     8  package winc
     9  
    10  import (
    11  	"github.com/secoba/wails/v2/internal/frontend/desktop/windows/winc/w32"
    12  )
    13  
    14  func RegMsgHandler(controller Controller) {
    15  	gControllerRegistry[controller.Handle()] = controller
    16  }
    17  
    18  func UnRegMsgHandler(hwnd w32.HWND) {
    19  	delete(gControllerRegistry, hwnd)
    20  }
    21  
    22  func GetMsgHandler(hwnd w32.HWND) Controller {
    23  	if controller, isExists := gControllerRegistry[hwnd]; isExists {
    24  		return controller
    25  	}
    26  
    27  	return nil
    28  }