energy/cef/cef-base-component.go

35 lines
629 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 {
2022-11-29 20:04:08 +08:00
return _GetHandle(m.procName, m.instance)
2022-10-26 21:07:02 +08:00
}
func (m *BaseComponent) IsValid() bool {
return m.instance != 0
}