Formless application

W

Wayne

I need an application to start run it's process, and save a log as it goes,
it will be automated with a scheduled task and as such requires no
interface. I don't want to use a service as it only needs to run once or
twice a week.

How would one go about making an application with no interface at all?

--
Thanks
Wayne Sepega
Jacksonville, Fl


"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
D

Denny Britz

How would one go about making an application with no interface at all?
Create an empty project, add a static Main-Method for startup
and set "Output Type" to Windows application.
 
B

Brendan Grant

Tricky problem as setting Visible to False or doing a
this.Hide() only work after the form has finished loading.

If you head on into your Main function and change
Application.Run(new YourStartupForm) to Application.Run(),
the form will be loaded in the background and still
be 'running', just not visibly (as far as the form is
concerned).

A quick tests to show this works would be throwing an
enabled timer onto the form that simply prints something
out to the console.

Brendan
 
B

Brendan Grant

My apologies, I goofed in my previous post. Prior to
calling Application.Run(), you need to create an instance
of your form, so your Main would end up looking something
like.

YourStartupForm foo = new YourStartupForm();
Application.Run();
 
L

Landi

Wayne,
make a windows service, it will run in the background and you will never see
it. You can also set CPU priority if it's something that want to run above
anything else.
 
W

Wayne

Denny Britz suggested doing this a couple posts back:
Create an empty project, add a static Main-Method for startup
and set "Output Type" to Windows application.

So far it's been working great.

Wayne
 

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

Similar Threads

TollBox Pushpin effect 2
Beta 2 News Groups 1
Profiling tool for C# and .net 2.0 2
windows form datagrid questions 2
XmlSerializer 3
///Summary <-- help file generation 2
XmlCodeExporter 3
Comma delimited text 9

Top