Howto change a C# winforms Screen Saver's Title in Display Properties?

  • Thread starter Thread starter Mark van Dijk
  • Start date Start date
M

Mark van Dijk

Hi there,

I have a farely simple question that I can't seem to find the answer
to.

I've got a C# Winforms application that after building results in an
executable. This executable is then renamed to an .scr file and used as
a Screen Saver.

How can I get this file to come up with a different name than the
filename in the dropdown list in Display Properties/Screen Saver? My
screensaver's filename is "screensaver.scr" and the dropdown shows
"screensaver", instead of a more friendly name "My Beautiful Screen
Saver".

I've searched everywhere but all I get is things that refer to a
StringTable, where you have to add a row with ID 1 and name "title" and
value "screensaver title". This should result in a different Title
being used in the dropdown mentioned before. However, I don't know how
to add this StringTable to my C# project.
When I open existing .scr files (that come with windows) in VS.Net
using the Resource Editor I see a StringTable that indeed contains this
ID 1 row, but when I open my own executable, I don't even have a
StringTable.

I hope someone can advise me on what to do.

Thanks in advance,


Mark
 
Mark,

The C# compiler has a command line option to add a Win32 resource to
your exe. What you want to do is create a resource file (with your string
table) and then use the resource compiler to generate the resource file.
Once you have the .res file, you can set the /win32res flag when calling
csc.exe and point to that file to be included in the executable.

Hope this helps.
 
Back
Top