Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7784371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:05:05+00:00 2026-06-01T20:05:05+00:00

I have a basic question about using WndProc in my form application. I want

  • 0

I have a basic question about using WndProc in my form application. I want to know what is the use of the WndProc method when i have form events available. In which cases do i need to create custom messages? MSDN tells that it is used only to process the Windows messages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:05:06+00:00Added an answer on June 1, 2026 at 8:05 pm

    The WndProc is how WinForms provides a wrapper around the Win32 windows messages with an easier to use and understand .NET layer.

    Typically it works in the following way. Take the example of the WM_LBUTTONDOWN windows message. The Windows.Forms.Control.WndProc will intercept this message and extract relevant information from the WPARAM and LPARAM of the message. Then it calls the protected virtual method OnMouseDown with relevant information nicely packaged into an MouseEventArgs. The implementation will then fire the MouseDown event at the end of its own processing.

    So dealing with a set of OnXXXX methods/XXXX events is much easier then intercepting the windows messages directly.

    But what if the windows message you are interested in is not handled by WinForms? In that case you can override the WndProc and handle it yourself directly. Another use is to intercept a message and then discard it before the control itself has a chance to process it. Or you can create custom messages for sending between controls within your application. Also useful for debugging when you want to see every message your control receives, you only need to add logging in the one place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I might have pretty basic question about regex. I have the following regex, which
I am using Visual Basic 2008 and I have a question about it? I
I have very basic question about the use of high performance cluster in our
I have a very basic question about SVN. I know SVN has pretty strict
I have a basic question about using the Best Practices in coding. (I'm using
I have a basic question about assembly. Why do we bother doing arithmetic operations
I am making a webapp. I have a fairly basic question about javascript performance.
Sorry about the wording for my question title. I have a basic HTML anchor
I have really basic question. How can I get form id by input element
Good day everyone. I have a question about making and using derived classes of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.