Leaders dynamic_sysop Posted May 15, 2003 Leaders Posted May 15, 2003 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 ? i'm 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. i'm 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 . Quote
Leaders dynamic_sysop Posted May 15, 2003 Author Leaders Posted May 15, 2003 s'ok 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 ) Quote
*Experts* Bucky Posted May 15, 2003 *Experts* Posted May 15, 2003 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 don't completely understand your other questions... Do you already know how to subclass (override the WndProc method)? Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Leaders dynamic_sysop Posted May 15, 2003 Author Leaders Posted May 15, 2003 i subclass in vb6 yes , but i'm having a bit of a headache with something so i thought i'd try with .net. cheers Quote
Recommended Posts