-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodSubClass.bas
48 lines (34 loc) · 1.1 KB
/
modSubClass.bas
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
44
45
46
47
Attribute VB_Name = "modSubClass"
Option Explicit
Public defWindowProc2 As Long
Function WindowProc(ByVal hwnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
On Error Resume Next
Dim retval As Long
Select Case hwnd
Case frmMain.hwnd
Select Case Msg
Case Else
retval = CallWindowProc(defWindowProc2, _
hwnd, _
Msg, _
wParam, _
lParam)
End Select
End Select
WindowProc = retval
End Function
Function HiWord(dw As Long) As Integer
If dw And &H80000000 Then
HiWord = (dw \ 65535) - 1
Else: HiWord = dw \ 65535
End If
End Function
Function LoWord(dw As Long) As Integer
If dw And &H8000& Then
LoWord = &H8000 Or (dw And &H7FFF&)
Else: LoWord = dw And &HFFFF&
End If
End Function