The sub named WndProc that you see used in the code gets automatically called by Windows every time a "Message" is sent to your window (or to all windows).

vb Code:
  1. Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

So to use the code just copy everything below "Public Class Form1" from the code I posted in post #13 and paste that into your form