system tray help

  • Thread starter Thread starter sonali_reddy123
  • Start date Start date
S

sonali_reddy123

Re - systray help

This is my code for function which i have written in modulemain() and
if multiple instances of an application are detected then after
execution of following code to restore the
previous instance my application should exit.

But in this case the FindWindow method returns value 0 so that no
instance is getting restored.

(Previous instance of my application is in minimized in systray).

Public Function MultipleInstancesRunning1() As Boolean

If UBound(System.Diagnostics.Process.GetProcessesByName( _
System.Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0
Then
Me.Text = Me.Text & "X"
Dim Handle As IntPtr = FindWindow(Nothing, SearchText)
ShowWindow(Handle, SW_RESTORE)
End
End If

end function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top