views:

726

answers:

4

If I were to want to create a nice looking widget to stay running in the background with a small memory footprint, where would I start building the windows application. It's goal is to keep an updated list of items off of a web service. Similar to an RSS reader.

note: The data layer will be connecting through REST, which I already have a C# dll, that I assume will not affect the footprint too much.

Obviously i would like to use a nice WPF project, but the ~60,000k initial size is too big.

*C# Forms application is about ~20,000k

*C++ Forms ~16,000k

*CLR or MFC much smaller, under 5

Is there a way to strip down the WPF or Forms? and if im stuck using CLR or MFC what would be the easiest way to make it pretty. (my experience with MFC is making very award forms)

Update: Clarification The above sizes, are the memory being used as the process is ran, not the executable.

A: 

If you "already have a C# dll" you're intending to use then there must be .net already installed on the target machine.

In that case, a C# win forms app need not be anywhere near 20 meg. The smallest hello world type win form would be 7 kilobytes.

Leon Bambrick
A: 

If it must really be as small as possible, use plain C and talk to the Windows API directly.

However, since you're going to have the CLR loaded anyway because of the .NET dll, I would opt for something less painful and simply use C# for the UI as well.

Thomas
+2  A: 

re:

Update: Clarification The above sizes, are the memory being used as the process is ran, not the executable.

Okay, when you run a tiny C# Win Forms app, the smallest amount of RAM that is reserved for it is around 2 meg, maybe 4 meg. This is just a working set that it creates. It's not actively using all of this memory, or anything like it. It just reserves that much space up front so it doesn't have to do long/slow/expensive requests for more memory later as needed.

Reserving a smaller size upfront is likely to be a false optimization.

(You can reduce the working set with a pinvoke call if it really matters. see pinvoke for 'set process working set size' )

Leon Bambrick
A: 

Why not use Silverlight? Here is an article that talks about doing just that.

markti