Re: Getting prog to run when the first desktop window is ahown after l
- From: "Newbie Coder" <newbiecoder@xxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 11:14:31 +0100
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
--
Newbie Coder
(It's just a name)
"Sanjeev Sharma" <Sanjeev Sharma@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A732C7CF-5194-4303-9B23-6243B7B2BFBE@xxxxxxxxxxxxxxxx
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.
.
- Follow-Ups:
- Re: Getting prog to run when the first desktop window is ahown aft
- From: Sanjeev Sharma
- Re: Getting prog to run when the first desktop window is ahown aft
- Prev by Date: Re: reading a CD or a flash memory stick
- Next by Date: Re: jumping between windows
- Previous by thread: Xp Update problem
- Next by thread: Re: Getting prog to run when the first desktop window is ahown aft
- Index(es):
Relevant Pages
|