I am having trouble subclassing ragrid (for the purpose of intercepting mouse events) in a program that places controls onto a window.

Also, it appears that you are setting GWL_USERDATA in your code. The docs say that this entry is for use of the user and is initialized to 0.

I have had very good luck using your raedit and ragrid contols and appreciate them very much.


Posted on 2004-07-26 00:38:12 by msmith
From the looks of the code, the actual RAGrid control does not have it's GWL_USERDATA set, he does use the field in a number of child windows of the grid control but not in the actual main control window so it should be fine to use it.

For subclassing, what is the exact nature of the problem, are you not receiving the messages in the subclass procedure ?
Posted on 2004-07-26 07:27:28 by donkey
On a static, button, calendar, etc. I get:

mousemove: wmsg=512
mousedown: wmsg=513
mouseup: wmsg=514

On ragrid I get:

mousemove: wmsg=160 or 32
mousedown: wmsg=1042 or 1043
mouseup: wmsg=never get it

I'm sure that all this is separate from the USERDATA question.
Posted on 2004-07-26 09:16:32 by msmith
Hi msmith

This version of RAGrid.dll shoud work better on mouse events.

Posted on 2004-07-26 09:41:20 by KetilO

Thank you for the quick response, but did not fix my problem.

Not being knowledgable like yourself on the inner workings of controls, I am clueless as to what is happening.

What I don't understand is why I cannot intercept all messages going to ragrid like I can on static, button, text, etc.

Are you resetting the GWL_WINDOWPROC after I have set it?


Posted on 2004-07-26 11:17:43 by msmith
Hi msmith

Don't know what happend to the previous upload.
I have uploaded a new ragrid.dll including a test project.

Posted on 2004-07-26 14:50:22 by KetilO

Where is this download?

The one on your RadAsm site says 6-17-2004.

The link on page one of the ragrid thread also says 6-17-2004

Posted on 2004-07-26 15:52:34 by msmith
Look a few posts up. The attachment is updated.

Posted on 2004-07-26 16:20:38 by KetilO

Now it works fine. Thank you.

What I don't understand is why, if I set the GWL_WINDOWPROC to my own proc, then why does it matter what you do inside the control concerning mouse events. Why don't I, then, own the mouse events?

Posted on 2004-07-26 17:49:32 by msmith