subclassing? the "lParam" value.

dynamic_sysop

Well-known member
Joined
Oct 1, 2002
Messages
1,039
Location
Ashby, Leicestershire.
hi i know that to grab events using subclassing in vb.net you can get the msg value ( using ByRef m As Message ) but is it possible to get the other parts, like wParam and lParam ?
im just wondering as without them bits the subclass seems a bit useless:-\ . i want to hook a window and view all messages that pass through it , but all i seem to get is the "message" eg : WM_PAINT. im already aware that i cant use the AddressOf function as in vb6 ( it says cant use a reference to a long or something )
any ideas on how to be able to watch the other params would be great. all i can find is this ... System.Windows.Forms.Message which represents the actuall message .
 
sok i may have an idea now :) msg.LParam ( msg being the main message received )
1 thing tho, does the lParam have to be converted to a long or an IntPtr ? ( what ever an IntPtr is :-\ , a pointer to an integer at a guess )
 
An Integer in VB.NET is a 32-bit number variable, which is the
same as a Long in VB6, so you do not need to convert the
params and messages to Longs.

You can convert the Integer into an IntPtr if the parameter is
a handle to a window, an hDC, or anything of that nature. Then
you can use the IntPtr in .NET functions.

I dont completely understand your other questions... Do you
already know how to subclass (override the WndProc method)?
 
Back
Top