forked from ying32/govcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intf.go
43 lines (33 loc) · 776 Bytes
/
intf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
package rtl
import . "github.com/ying32/govcl/vcl/types"
func MakeWord(A, B uint8) uint16 {
return uint16(A | B<<8)
}
func MakeLong(A, B uint16) int32 {
return int32(A | B<<16)
}
func HiWord(L uint32) uint16 {
return uint16(L >> 16)
}
func HiByte(W uint8) uint8 {
return W >> 8
}
func MakeWParam(l, h uint16) WPARAM {
return WPARAM(MakeLong(l, h))
}
func MakeLParam(l, h uint16) LPARAM {
return LPARAM(MakeLong(l, h))
}
func MakeLResult(l, h uint16) LRESULT {
return LRESULT(MakeLong(l, h))
}
func PointToLParam(P TPoint) LPARAM {
return LPARAM((P.X & 0x0000FFFF) | (P.Y << 16))
}