Handling WM_SIZING message in WndProc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to handle the WM_SIZING message in the Form.WndProc method in order to perform custom logic while the user is resizing a form. But, I have two questions:

1. The help for WM_SIZING states, "An application should return TRUE if it processes this message." How do you do this? Is it by setting m.Result? If so, then could somebody please show me an example of how to set m.Result to TRUE (since m.Result is of type IntPtr rather than of type Boolean)?

2. Can somebody please tell me if using Marshal.StructureToPtr is the appropriate method to use if I want to change the value of m.LParam? Using Marshal.StructureToPtr seems to work, but I just want to make sure that there isn't a better technique.

Thanks for any help.
Lance
 
Hi,

1) The documention is for c++. In c++ windproc is a function not a sub
therefore you have to return a value. Dont worry about it in vb.net

2) You are using the best method.

Ken
-------------
Lance said:
I need to handle the WM_SIZING message in the Form.WndProc method in order
to perform custom logic while the user is resizing a form. But, I have two
questions:
1. The help for WM_SIZING states, "An application should return TRUE if it
processes this message." How do you do this? Is it by setting m.Result?
If so, then could somebody please show me an example of how to set m.Result
to TRUE (since m.Result is of type IntPtr rather than of type Boolean)?
2. Can somebody please tell me if using Marshal.StructureToPtr is the
appropriate method to use if I want to change the value of m.LParam? Using
Marshal.StructureToPtr seems to work, but I just want to make sure that
there isn't a better technique.
 
Back
Top