Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vcl/types/types_amd64arm.go → vcl/types/types_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//----------------------------------------

//go:build amd64 || arm64
// +build amd64 arm64
//go:build amd64
// +build amd64

package types

Expand Down
29 changes: 29 additions & 0 deletions vcl/types/types_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------

//go:build arm64
// +build arm64

package types

type TDWordFiller struct {
Filler [4]uint8
}

// TWMKey
type TWMKey struct {
Msg uint32
MsgFiller TDWordFiller
CharCode [2]uint16
// CharCode: Word;
// Unused: Word;
CharCodeUnusedFiller TDWordFiller
KeyData uint32
KeyDataFiller TDWordFiller
Result uintptr
}
20 changes: 20 additions & 0 deletions vcl/win/const_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------

package win

const (
// SetWindowPos Flags

HWND_TOPMOST uintptr = 0xffffffffffffffff // -1
HWND_NOTOPMOST uintptr = 0xfffffffffffffffe // -2
)

const (
INVALID_HANDLE_VALUE uintptr = 0xffffffffffffffff // -1
)
26 changes: 26 additions & 0 deletions vcl/win/func_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------

// +build windows

package win

//func ToUInt64(r1, r2 uintptr) uint64 {
// return uint64(r1)
//}
//

func ToUInt64(r1, r2 uintptr) uint64 {
ret := uint64(r2)
ret = uint64(ret<<32) + uint64(r1)
return ret
}

func UInt64To(val uint64) (uintptr, uintptr) {
return uintptr(val), 0
}
25 changes: 25 additions & 0 deletions vcl/win/kernel32dll_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------

// +build windows

package win

import "unsafe"

// VerSetConditionMask
func VerSetConditionMask(dwlConditionMask uint64, dwTypeBitMask uint32, dwConditionMask uint8) uint64 {
r, _, _ := _VerSetConditionMask.Call(uintptr(dwlConditionMask), uintptr(dwTypeBitMask), uintptr(dwConditionMask))
return uint64(r)
}

// VerifyVersionInfo
func VerifyVersionInfo(lpVersionInformation *TOSVersionInfoEx, dwTypeMask uint32, dwlConditionMask uint64) bool {
r, _, _ := _VerifyVersionInfo.Call(uintptr(unsafe.Pointer(lpVersionInformation)), uintptr(dwTypeMask), uintptr(dwlConditionMask))
return r != 0
}
35 changes: 35 additions & 0 deletions vcl/win/user32dll_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------

// +build windows

package win

import (
. "github.com/ying32/govcl/vcl/types"
)

var (
_GetWindowLongPtr = user32dll.NewProc("GetWindowLongPtrW")
_SetWindowLongPtr = user32dll.NewProc("SetWindowLongPtrW")
)

func WindowFromPoint(point TPoint) HWND {
r, _, _ := _WindowFromPoint.Call(uintptr(ToUInt64(uintptr(point.X), uintptr(point.Y))))
return HWND(r)
}

func WindowFromPhysicalPoint(point TPoint) HWND {
r, _, _ := _WindowFromPhysicalPoint.Call(uintptr(ToUInt64(uintptr(point.X), uintptr(point.Y))))
return HWND(r)
}

func ChildWindowFromPoint(hWndParent HWND, point TPoint) HWND {
r, _, _ := _ChildWindowFromPoint.Call(uintptr(hWndParent), uintptr(ToUInt64(uintptr(point.X), uintptr(point.Y))))
return HWND(r)
}