source: trunk/Include/Classes/System/Windows/Forms/Message.ab@ 447

Last change on this file since 447 was 388, checked in by イグトランス (egtra), 17 years ago

Stringなどで例外を投げるようにした。
#147の解決。
CType ASCII文字判定関数群の追加。

File size: 1.8 KB
Line 
1' Classes/System/Windows/Forms/Message.ab
2
3#ifndef __SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
4#define __SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
5
6'#require <windows.sbp>
7
8Namespace System
9Namespace Windows
10Namespace Forms
11
12Class Message
13Public
14 Const Function HWnd() As HWND
15 Return hwnd
16 End Function
17
18 Sub HWnd(hw As HWND)
19 hwnd = hw
20 End Sub
21
22 Const Function Msg() As DWord
23 Return msg
24 End Function
25
26 Sub Msg(m As DWord)
27 msg = m
28 End Sub
29
30 Const Function WParam() As WPARAM
31 Return wp
32 End Function
33
34 Sub WParam(wParam As WPARAM)
35 wp = wParam
36 End Sub
37
38 Const Function LParam() As LPARAM
39 Return lp
40 End Function
41
42 Sub LParam(lParam As LPARAM)
43 lp = lParam
44 End Sub
45
46 Const Function Result() As LRESULT
47 Return lr
48 End Function
49
50 Sub Result(res As LRESULT)
51 lr = res
52 End Sub
53
54 /*Const*/ Function Equals(x As Message) As Boolean
55 Return hwnd = x.hwnd And _
56 msg = x.msg And _
57 wp = x.wp And _
58 lp = x.lp And _
59 lr = x.lr
60 End Function
61
62 Override Function GetHashCode() As Long
63 Return _System_HashFromPtr(hwnd) Xor (Not msg) Xor _System_HashFromPtr(wp As VoidPtr) Xor _
64 (Not _System_HashFromPtr(lp As VoidPtr)) Xor _System_HashFromPtr(lr As VoidPtr)
65 End Function
66
67 Const Function Operator ==(x As Message) As Boolean
68 Return Equals(x)
69 End Function
70
71 Const Function Operator <>(x As Message) As Boolean
72 Return Not Equals(x)
73 End Function
74
75 Static Function Create(hwnd As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As Message
76 Create = New Message
77 With Create
78 .hwnd = hwnd
79 .msg = msg
80 .wp = wp
81 .lp = lp
82 End With
83 End Function
84
85Private
86 hwnd As HWND
87 msg As DWord
88 wp As WPARAM
89 lp As LPARAM
90 lr As LRESULT
91End Class
92
93End Namespace 'Forms
94End Namespace 'Widnows
95End Namespace 'System
96
97#endif '__SYSTEM_WINDOWS_FORMS_MESSAGE_AB__
Note: See TracBrowser for help on using the repository browser.