energy/cef/cef-base-component.go

35 lines
628 B
Go
Raw Normal View History

2022-10-04 13:21:05 +08:00
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
2022-10-04 16:38:43 +08:00
// Licensed under GNU General Public License v3.0
2022-10-04 13:21:05 +08:00
//
//----------------------------------------
package cef
import (
"github.com/energye/golcl/lcl"
2022-10-26 21:07:02 +08:00
"github.com/energye/golcl/lcl/types"
2022-10-04 13:21:05 +08:00
"unsafe"
)
type BaseComponent struct {
lcl.TComponent
procName string
instance uintptr
ptr unsafe.Pointer
}
2022-10-26 21:07:02 +08:00
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
}