MGervais77
Jun 6th, 2000, 03:23 AM
I have been successful in subclassing a form and creating a custom Message Handler (WndProc Function).
What I would like to do is handle WM_SIZE or WM_WINDOWPOSCHANGING messages by verifying that the new form size is in fact within the acceptable range. However, the data I require in order to complete this is located in a memory block pointed to by lParam.
My question is this: How can I extract this data, change it as required, then put it back where Windows can then use it?
In the case of the WM_WINDOWPOSCHANGING Message, lParam is a pointer to a WINDOWPOS struct. I have been unsuccessful at even extracting this data correctly let alone modifying it or putting it back.
In the case of WM_SIZE, the lo-word of lParam is the new width and the hi-word is the new height. I am able to extract this information, but how do I modify it so that Windows knows that I modified it?
Any assistance would be appreciated.
[Edited by MGervais77 on 06-06-2000 at 04:26 PM]
What I would like to do is handle WM_SIZE or WM_WINDOWPOSCHANGING messages by verifying that the new form size is in fact within the acceptable range. However, the data I require in order to complete this is located in a memory block pointed to by lParam.
My question is this: How can I extract this data, change it as required, then put it back where Windows can then use it?
In the case of the WM_WINDOWPOSCHANGING Message, lParam is a pointer to a WINDOWPOS struct. I have been unsuccessful at even extracting this data correctly let alone modifying it or putting it back.
In the case of WM_SIZE, the lo-word of lParam is the new width and the hi-word is the new height. I am able to extract this information, but how do I modify it so that Windows knows that I modified it?
Any assistance would be appreciated.
[Edited by MGervais77 on 06-06-2000 at 04:26 PM]