473,396 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Handling WM_SIZING message in WndProc

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

Nov 20 '05 #1
4 4133
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" <zi***@hotmail.com> wrote in message
news:7B**********************************@microsof t.com...
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

Nov 20 '05 #2
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" <zi***@hotmail.com> wrote in message
news:7B**********************************@microsof t.com...
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

Nov 20 '05 #3
Thanks!
Nov 20 '05 #4
Thanks!
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jacek | last post by:
Hello Could someone tell me how to handle a message in my C# application sent from other application written in MFC C++, The message is sent using: ::SendMessage( hWndCallback, nMessage,...
2
by: Robert Wilson | last post by:
Hi everyone. I have a dialog box based application that I am developing for my employer. We are only just getting to grips with C~ having been developing in VC++ for ages. I am handling a...
4
by: vooose | last post by:
Is there any way to handle exceptions thrown by .NET classses? During runtime and at seemingly random times, exceptions similar to the ones shown at the base of this post are thrown. These errors...
4
by: iamnader | last post by:
Hi, Has anyone done any performance analysis of handling WndProc in C#? It seems like there must be significant overhead in jumping between native code and the CLR for every single Windows...
0
by: Lance | last post by:
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,...
8
by: jcrouse | last post by:
I am using the following code to trap errors in a sub routine: Try Executable code Catch ex As Exception Dim strInputE As String = Application.StartupPath & "\Error.txt" Dim srE As...
0
by: Wallace Pipp | last post by:
I have an MDI application where I need to draw a line using Left/Right arrow keys. It works fine if it has just one child, but with more than one it switches between children. I've tried the...
4
by: Darin | last post by:
Some of our customers get this message, occasionally and randomly. What does it mean and what can I do to trap it or (better yet) fix it so it doesn't occur? See the end of this message for...
6
by: JDeats | last post by:
I have a WinForms based application written for the .NET Framework 2.0 and in this application I need to be able to be able to take some action in code when the user finishes resizing the form. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.