views:

123

answers:

2

I have a working screensaver and would like to figure out how I can control the name Windows displays in the screensaver drop down list. Currently it all seems to be based on the filename but I know that can't be the case. Here's what I've tried and the results:

Filename: CC.Votd.scr ScreenSaver Name: Cc

Filename: CC Votd.scr ScreenSaver Name: Cc Votd

I'd like to have the file be named CC.Votd.scr and have the screensaver name display as CC.Votd (capitalization is important to me so even CC Votd would be ok :-))

I'm pretty sure this is possible because the Photos screensaver is PhotoScreensaver.scr

Thanks in advance for your help.

+3  A: 

This thread has the answer:

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/35ea8aeb-e729-474c-b6d2-544fc3c48d8d

Adam Ruth
Awesome man, that did it for me. Not sure why I couldn't find this in Google :-)
Cory Charlton
+2  A: 

The screensaver name is pulled from native resources of the .scr file. so you would need to add an unmanaged resource. and use string ID 1 for the name.

The .rc file would look like this

STRINGTABLE
BEGIN
   1 "My Screensaver"
END
John Knoeller
I just read the link posted by other answer, and noticed the steps were all assuming an IDE. So I'm glad to see it isn't totally impossible to do by hand. But how does the project know to use the resource as the title? Is that the only possible thing String Tables can be used for?
Anthony
The project has absolutely no idea that it needs to be used as the title - in fact, it doesn't even know what the "title" is. All it knows is "hey, this guy wants a native resource embedded in the application". The screensaver dialogue then pulls out the first string resource and uses that as the "title" of the screensaver.
Anon.
I don't think it's the project that is using it so much as the screen saver dialog is looking in the executable, for a string table that contains a row with no id and the value of 1.
Cory Charlton
Yes, the dialog is making the assumption that string id 1 (or possibly the first string) is the title. It's a pretty brain-damaged design, but .scr files go back all the way to windows 3.x so what can you do?
John Knoeller
+1 for the great info. That was much less painful than I expected. Even adding my pretty icon back was a breeze :-)
Cory Charlton
@Cory: I've always felt it's easier to edit the .rc file with a text editor than to use the IDE - It annoys the heck out of me that double clicking on .rc files causes the IDE to _compile_ them rather than just opening up the text file <sigh>
John Knoeller
@Anthony: No stringtables are used for many things, the dialog is apparently just _assuming_ that the first string is the title, just like Windows assumes that it should use the first Icon as your application icon. it's the way things were done back in the Win3x days.
John Knoeller