Getting prog to run when the first desktop window is ahown after l

G

Guest

I didn't find appropriate forum for asking Windows based question in MSDN, so
I posted it here. I need to get my program to run just after the log in and
when the desktop is shown first. Tried using service but my program need to
run under the current user rather than under "SYSTEM". Please direct me to
appropriate forum if necessary.
 
N

Newbie Coder

Sanjeev,

MSDN have their own managaed forums if you are a subscriber

What language are you writing in?

V C++

microsoft.public.dotnet.languages.vc

VB.NET

microsoft.public.dotnet.languages.vb

ASP.NET

microsoft.public.dotnet.framework.aspnet

C#:

microsoft.public.dotnet.languages.csharp

Anyway,

If you are using a service controller object in .NET languages you can set it to
run as current user not just system. But using a service if the application runs
for a few seconds or a few minutes is a waste of computer resourses

Best thing you can do is add your application to the current user RUN key

Simply:

Imports Microsoft.Win32

Dim reg As RegistryKey =
Registry.CurrentUser.OpenSubKey(Software\Microsoft\Windows\Current Version\Run",
True) 'Open for writing
Dim strAppPath As String = Application.ExecutablePath()

Try

reg.SetValue("My Startup Name Here", strAppPath)

Catch ex As Exception

MessageBox.Show("Unable to create startup entry", "My Application Name)

Finally

If not (reg Is Nothing) Then reg.Close()

End Try
 
G

Guest

Ya, I already knew about putting a value in the "...\Run" key in the
registry. But that doesn't work for me. I need to start my program just after
the log screen is removed and the desktop is shown. Using the above
technique, the program is launched only minutes later when everything in the
desktop has been loaded. My program is made with VB6 (it has lost its
technical support but does that matter?). What about launching the program
with 'wlnotify.dll' (My program doesn't need to be compatible with Win
Vista)? Does it run programs under the current user? Or please suggest me any
other way. I can use VC++ 6.0 or VC++ .NET Express where necessary.
Sanjeev
 

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

Top