By the way, just tried the same code with another machine. Same problem. The entire code is this

Code:
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
<<snip>>
#End Region

    Public Declare Auto Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Auto Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim lhWnd As Long
        lhWnd = FindWindow("mIRC", vbNullString)
        MsgBox(lhWnd)

    End Sub

End Class

Last edited by orcberg; 21/05/05 03:52 PM.