Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleSubclass to read Windows messages in VB .NET
Keywordssubclass, WindowProc, messages, VB.NET, NET
CategoriesTips and Tricks, API, VB.NET
 
In the code editor's left dropdown list, select (Overrides). Then in the right dropdown select WndProc. The new WndProc receives a Message object as a parameter. Use its ToString method to display the message's name.

Call the base class's WndProc method to process the message normally. This is very important! If you don't process the message normally, the form will not be able to resize itself, draw its interior, and perform other standard Windows functions.

 
Protected Overrides Sub WndProc(ByRef m As _
    System.Windows.Forms.Message)
    Debug.WriteLine(m.ToString)
    MyBase.WndProc(m)
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated