Subclassing

Other Messages

Below is a list of some of the other messages you can catch when subclassing, and when they occur. For the constant declarations, use the API Viewer. Take a look at the SDK documentation in MSDN for extensive definitions and what is actually passed in the lParam and wParam parameters (these vary from message to message)

Message Occurs...
WM_MOVE when the form is moved
WM_NCLBUTTONDOWN when the left mouse button is pressed on the title bar
WM_NCLBUTTONUP when the left mouse button is raised off the title bar
WM_NCLBUTTONDBLCLK when the left mouse button is double clicked on the title bar
WM_NCRBUTTONDOWN when the right mouse button is pressed on the title bar
WM_NCRBUTTONUP when the right mouse button is raised off the title bar
WM_NCRBUTTONDBLCLK when the right mouse button is double clicked on the title bar
WM_NCMOUSEMOVE when the mouse is moved over the titlebar
WM_NCACTIVATE when the title bar is activated
WM_ACTIVATE when the form is activated
WM_EXITSIZEMOVE when the mouse is released after moving the form
WM_VSCROLL when the textbox is scrolled vertically
WM_HSCROLL when the textbox is scrolled horizontally
WM_MENUSELECT when a menu is moved over by the mouse.
WM_PAINT when the form is redrawn
WM_GETMINMAXINFO when windows requests the minimum and maximum form sizes
WM_NOTIFY when a control on the form is sent a message

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“My definition of an expert in any field is a person who knows enough about what's really going on to be scared.” - P. J. Plauger