Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


vb my application run even in logoff state


vb my application run even in logoff state

Author
Message
M.L.Srinivas
M.L.Srinivas
Forum God
Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)

Group: Forum Members
Posts: 17, Visits: 1

Hi,

I want vb my application run even in logoff state. For this I tried using windows task scheduler.

This went off successfully, but when I login I observed that the application is running as a process with no
UI.

Now, if the user tries to execute the application, I want to check whether my application is still running
in the background or not. If it is running in the background I want to make the same instance visible to the user.

How to do this?

I thought of reading the list of processes running and if the appl. is there I want to make it visible.

Is this possible?

Can we get the list of process running on the system from vb?


please help.


thanks
-Srinivas


mayurkotlikar
mayurkotlikar
Forum God
Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)

Group: Forum Members
Posts: 11, Visits: 1

Check my reply in this post:

http://www.a1vbcode.com/vbforums/shwmessage.aspx?ForumID=5&MessageID=11695



Mayur Kotlikar
mayurkotlikar
mayurkotlikar
Forum God
Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)Forum God (1.8K reputation)

Group: Forum Members
Posts: 11, Visits: 1

You can also do this, i have added this to your DevX post:

I think instead of enumerating the processes, you go for creating a Mutex.
Public Declare Function CreateMutex Lib "kernel32.dll" Alias "CreateMutexA" ( _
lpMutexAttributes As Any, _
ByVal bInitialOwner As Boolean, _
ByVal lpName As String) As Long

Give your application name in lpName and preserve the handle returned.


Whenever your application starts, try to create the mutex, it the mutex already existes, it means you application is already running. Use FindWindows to find your application windows and show it.

Use CloseHandle to close the mutex handle when you exit.



I know we have App.PrevInstance but it is not reliable.


Mayur Kotlikar
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search