如何在C ++中为Windows编写屏幕保护程序? [英] How can I write a screen saver for Windows in C++?
问题描述
我想使用Windows API为Windows编写屏幕保护程式。
I want to write a screen saver for Windows using the Windows API. How can I start to write it?
推荐答案
基本上,屏幕保护程序只是一个普通的应用程序,接受几个命令行选项,提供
Basically a screensaver is just a normal application that accepts a few command line options, provided by windows, to determine if it should start fullscreen or in a preview window.
因此,编写一个普通的exe应用程序,它接受以下命令行参数(从 href =http://msdn.microsoft.com/en-us/library/ms686421(v=vs.85).aspx> http://msdn.microsoft.com/en-us/library/ms686421(v = vs85).aspx ):
So, write a normal exe-application that takes the following command line arguments (from http://msdn.microsoft.com/en-us/library/ms686421(v=vs.85).aspx):
- / s - 以全屏模式启动屏幕保护程序。
- / c - 显示配置设置对话框。
- / p #### - 使用指定的窗口句柄显示屏幕保护程序的预览。
下一步检查一些DirectX / OpenGL / SDL教程,并写一些眼睛糖果。
Next check out some DirectX / OpenGL / SDL tutorials and write some eye candy.
显然,你应该检查鼠标移动和按键,用户将被唤醒。
Obviously you should check for mouse movements and key presses and exit your application if the user wakes up.
这篇关于如何在C ++中为Windows编写屏幕保护程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!