0

I coded a Windows screensaver using C++/WinAPIs some time ago but now when I try it on Windows 8 at a logon screen (when no users are yet logged in) it doesn't seem to work. It is clearly a bug in Windows 8, because when I reboot the system my screensaver begins to work just fine. (Note that this behavior never happened on any previous version of Windows.)

What happens is that when the screensaver starts, the screen turns black and nothing happens after that moment. Obviously I can't debug it with the Visual Studio, so I added a trace statement into the first line where it should begin executing in WM_CREATE in ScreenSaverProc() but that line never gets called when the screensaver hangs up like I described above.

This tells me that some initialization code hangs up before the WM_CREATE message is sent, but to fix that I do not have access to that code because Microsoft's tutorial on WinAPI screensavers instructs to link to Scrnsave.lib (or ScrnsavW.lib in my case.)

So I was wondering, is there any way to build a WinAPI screensaver without using Scrnsave.lib?

ahmd0
  • 16,633
  • 33
  • 137
  • 233
  • 2
    I'm hesitant to read through a question that asserts that "It is clearly a bug in Windows 8"... – Kerrek SB Aug 13 '12 at 08:50
  • What, the fact that Windows 8 is "full of holes" is news for you? http://social.technet.microsoft.com/Forums/en-US/w8itproappcompat/thread/4c1bc349-7525-4372-a244-48fb3d662536/ – ahmd0 Aug 13 '12 at 09:08
  • A note on debugging - if you get to the point where it is appropriate, you can debug it using remote debugging. If you have just one machine you can create a VM or something. – shoosh Aug 13 '12 at 09:12
  • @shoosh: true, but I can't debug into a statically linked ScrnsavW.lib. Plus it's a tricky context -- screensaver, when no users logged in yet... – ahmd0 Aug 13 '12 at 09:15
  • @ahmd0: For remote debugging, the (user) context doesn't matter. It's just code, running in userspace. – MSalters Aug 13 '12 at 11:00

0 Answers0