energy/cef/cef-base-component.go
2022-11-29 20:04:08 +08:00

35 lines
629 B
Go

//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under GNU General Public License v3.0
//
//----------------------------------------
package cef
import (
"github.com/energye/golcl/lcl"
"github.com/energye/golcl/lcl/types"
"unsafe"
)
type BaseComponent struct {
lcl.TComponent
procName string
instance uintptr
ptr unsafe.Pointer
}
func (m *BaseComponent) Instance() uintptr {
return m.instance
}
func (m *BaseComponent) Handle() types.HWND {
return _GetHandle(m.procName, m.instance)
}
func (m *BaseComponent) IsValid() bool {
return m.instance != 0
}