This only works if you are loading a Windows Form, not a Module.
Bobbo
If NoLoad(Me) then end
Private Declare Auto Function FindWindow Lib "user32.dll" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As
IntPtr
Private Declare Auto Function ShowWindow Lib "user32.dll" _
(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As Boolean
Public Function NoLoad(ByRef sender As System.Object) As Boolean
If UBound(System.Diagnostics.Process.GetProcessesByNa me( _
System.Diagnostics.Process.GetCurrentProcess.Proce ssName)) > 0 Then
Const SW_RESTORE As Integer = 9
Dim SearchText As String = sender.Text
sender.Text = sender.Text & "X"
ShowWindow(FindWindow(Nothing, SearchText), SW_RESTORE)
sender.Text = SearchText
Return True
Else
Return False
End If
End Function
__________________________________________________ _________
"ucasesoftware" <uc***********@hotmail.fr> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
how to have only one instance of my application ?