Well I've spent several days on this one, and I just don't seem to be grasping the concept. Just when I thought I had it figured out, I didn't...

These functions are upgraded from VB6 and check for open or duplicate windows before continuing along in my app.

The message is: Add a delegate for AddressOf EnumCallback.
Thanks in advance.

This is what I have so far:

Code:
'Functions, delegates, and variables for the app finder sub to see if applications are running.
Delegate Function EnumCallbackDelegate(ByVal lngAppWindow As Integer, ByVal lngParameters As Integer) As Integer
'As you can see I tried to create a delegate but I don't know
if I have done it properly, or exactly where and how to call it if so...
Declare Function EnumWindows Lib "user32" (ByVal wndenmprc As Integer, ByVal lParam As Integer) As Integer
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer
Private mstrTarget As String

--

Public Sub CheckOpenTask(ByRef strAppName As String)
        'Ask Windows for the list of tasks.

        mstrTarget = strAppName  'Assigns the application name from the call to the global variable.
        'UPGRADE_WARNING: Add a delegate for AddressOf EnumCallback Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'
        EnumWindows(AddressOf EnumCallback, 0) 
End Sub

--

Public Function EnumCallback(ByVal lngAppWindow As Integer, ByVal lngParameters As Integer) As Integer
        'Check a returned task to see if it exists or not.

        Dim strBuffer As New VB6.FixedLengthString(256)
        Dim strTitle As String
        Dim lngLength As Integer

        ' Get the window's title.
        lngLength = GetWindowText(lngAppWindow, strBuffer.Value, Len(strBuffer.Value))
        strTitle = Left(strBuffer.Value, lngLength)

        ' See if this is the target window.
        If InStr(strTitle, mstrTarget) <> 0 Then
            gintWindowsFound = gintWindowsFound + 1
        Else
            'Just keep checking for the program windows...
        End If

        ' Continue searching.
        EnumCallback = 1
End Function