How to invoke the screen saver in Windows in C#?

前端 未结 4 1010
别跟我提以往
别跟我提以往 2021-01-15 04:59

I\'d like to invoke the user\'s screen saver if such is defined, in a Windows environment.

I know it can be done using pure C++ code (and then the wrapping in C# is

4条回答
  •  暖寄归人
    2021-01-15 05:06

    I think having a .Net library function that does this is highly unlikely - I'm not aware of any. A quick search returned this Code Project tutorial which contains an example of a managed wrapper which you mentioned in your question.

    P/invoke exists so that you're able to access OS-specific features, of which screen savers are an example.

提交回复
热议问题