I have some code I want to reuse in several of my apps written in VB.net. I would like to put them in a module/class so I can reference them from other apps. One sub routine doesn't like being in a class\module and I was wondering how it coud be rewritten:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
'Have the base class handle all messages.
'Check if a new window has been created.
If m.Result.ToInt32 = WM_CREATE Then
'Check the new window to see if it has the charateristics that we are looking for. Namely that is has the Title that we want to find.
windowHandle = FindWindow(vbNullString, inputTitle)
'Make sure that the WindowHandle is not 0 which should mean it have a handle to the Inputbox window that we are wanting.
ElseIf windowHandle > 0 Then
'Call the code to set the textbox to a password textbox.
'Reset the handle back to 0 since the window handle will be different each time you display Inputbox window.
windowHandle = 0
VB doesn't let me put a Protected Overrrides in a module and it also doesn't like MyBase in a class or module. Any suggestions?