473,405 Members | 2,300 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,405 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 4134
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.