2 // System.Drawing.Message.cs
5 // Dennis Hayes (dennish@raytek.com)
7 // (C) 2002 Ximian, Inc. http://www.ximian.com
9 //TODO ?implment GetLParam.
12 namespace System
.Windows
.Forms
{
14 public struct Message
{
18 private IntPtr lparam
;
19 private IntPtr wparam
;
20 private IntPtr result
;
23 // -----------------------
24 // Public Shared Members
25 // -----------------------
32 /// Compares two Message objects. The return value is
33 /// based on the equivalence of the Msg, HWnd, LParam,
34 /// WParam, and Result properties of the two objects.
37 public static bool operator == (Message msg_a
,
40 return ((msg_a
.msg
== msg_b
.msg
) &&
41 (msg_a
.hwnd
== msg_b
.hwnd
) &&
42 (msg_a
.lparam
== msg_b
.lparam
) &&
43 (msg_a
.wparam
== msg_b
.wparam
) &&
44 (msg_a
.result
== msg_b
.result
));
48 /// Inequality Operator
52 /// Compares two Message objects. The return value is
53 /// based on the equivalence of the Msg, HWnd, LParam,
54 /// WParam, and Result properties of the two objects.
57 public static bool operator != (Message msg_a
,
59 return ((msg_a
.msg
!= msg_b
.msg
) ||
60 (msg_a
.hwnd
!= msg_b
.hwnd
) ||
61 (msg_a
.lparam
!= msg_b
.lparam
) ||
62 (msg_a
.wparam
!= msg_b
.wparam
) ||
63 (msg_a
.result
!= msg_b
.result
));
66 // -----------------------
67 // Public Instance Members
68 // -----------------------
88 public IntPtr LParam
{
97 public IntPtr WParam
{
106 public IntPtr Result
{
115 public static Message
create(IntPtr hWnd
, int msg
, IntPtr wparam
, IntPtr lparam
)
117 Message NewMessage
= new Message();
118 NewMessage
.msg
= msg
;
119 NewMessage
.wparam
= wparam
;
120 NewMessage
.lparam
= lparam
;
121 NewMessage
.hwnd
= hWnd
;
130 /// Checks equivalence of this Message and another object.
133 public override bool Equals (object obj
)
135 if (!(obj
is Message
))
138 return (this == (Message
) obj
);
142 /// GetHashCode Method
146 /// Calculates a hashing value.
149 public override int GetHashCode ()
151 return base.GetHashCode();// (int)( msg ^ lparam ^ wparam ^ result ^ whnd);
159 /// Formats the Message as a string.
162 public override string ToString ()
164 return String
.Format ("[{0},{1},{2},{3},{4}]", msg
.ToString(), lparam
.ToString(), wparam
.ToString(), result
.ToString(), hwnd
.ToString());
167 public object GetLParam(Type cls
){
168 throw new NotImplementedException ();
169 //return (object) lparam;