Hi,
I had also posted this question on following microsoft news-group
microsoft.public.dotnet.framework
One of the persons replied with a link to VB6 code that worked after a
little tweak to parameter types and return types.
However, I also found following links which seem to be equally
helpful...
http://www.csharpfriends.com/Forums/...x?PostID=27395
and
http://groups.google.to/group/micros...1da01e43c2ff49
Thanks,
--Mike
Michael M. wrote:
> The only things I can think of is using a command line switch such as
>
> Program.exe /autostarted
>
> You could then add that to the Applications Windows Text
>
> Me.Text = "Program Name" & Switch value.
>
> You could then use the API function getWindowText to retrive it
>
> Another way is to write the programs PID process Id to the registry with
> this same cmd line switch and the second program reads it
>
> Lastly you could use Custom Windows API Messages to query the process using
> SEND MESSAGE API
>
> Or, actualy, why not rename the second application and have two files?
>
>
> All of the above assume that I am that you are writing the program that will
> be scheduled though.
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> > I am writing a VB.NET application. It is a Windows application at the
> > moment.
> > The application contains a button. the click event of button perform a
> > long running task.
> > It needs to be started by windows task scheduler to carry out some
> > operation.
> >
> > When I am testing the application I want to differentiate if the
> > "differentiate between a program launched manually and launched by a
> > windows task scheduler" so that in the load event of form I can call
> > the function which carries out long running task when application is
> > started by scheduler OR else if it ws launched manually then nothing
> > will happen automatically. USer will have to click the button to
> > perform the operation.
> >
> > Again can someone show me ....
> > How to differentiate between a program launched manually and launched
> > by a windows task scheduler ???
> >
> > Any help is greatly appreciated....
> > Thanks in advance,
> > --Mike.
> >