Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

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 .

  • Leaders
Posted

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 )

  • *Experts*
Posted

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)?

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...