Windows 屏幕保护程序多个实例 [英] Windows screensaver multiple instance

查看:41
本文介绍了Windows 屏幕保护程序多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,Windows 屏幕保护程序只是一个传递 3 个参数之一的 exe.

So, a windows screensaver is just an exe that is passed one of 3 parameters.

/c for config screen
/s for fullscreen
/p <hwnd> for the little preview window. 

除了我有多个处理正在运行(这就是问题所在)之外,我的一切都正常工作.

I have everything working peachy except I have multiple processing running (this is the problem).

当您打开 Windows 屏幕保护程序选择器窗口并选择我的屏幕保护程序时,它会使用/p 启动它,以便它可以显示预览.如果您单击设置按钮,它将再次使用/c 调用我的 sreensaver.现在我有两个处理正在运行.当我关闭对话框时,我的进程结束,但 Windows 现在再次使用/p 调用我的屏幕保护程序.这些过程不断增加.

When you have the windows screensaver picker window open and select my screensaver, it launches it with /p so that it can show a preview. If you click the settings button, it will call my sreensaver again with /c. Now I there are two processing running. When I close the dialog, my process ends, but windows is now calling my screensaver again with /p . The processes keep adding up.

我该如何处理这个问题?我没有看到有关该主题的任何文档.我希望那里有人以前做过这件事.

How should I handle this problem? I dont' see any documentation on the subject. I am hoping someone out there has done this before.

我不想监视其他进程以只保持一个运行.必须有一个我没有看到的解决方案.

I don't want to monitor other processes to keep only one running. There has to be a solution I'm not seeing.

经过进一步调查,我看到 windows 将消息传递到您的屏幕保护程序:http://msdn.microsoft.com/en-us/library/cc144066%28v=vs.85%29.aspx

After further investigation, I see that windows passes messages to your screensaver: http://msdn.microsoft.com/en-us/library/cc144066%28v=vs.85%29.aspx

我设置了一个过滤器来捕获消息.我得到一切,但破坏.哈哈.我认为它会通过 WM_DESTROY 告诉你保释.

I setup a filter to catch the messages. I am getting everything but destroy. LOL. I would assume that it would pass WM_DESTROY to tell you to bail.

推荐答案

原来我回答了我自己的问题.请参阅上面的 msdn 链接.您必须监视消息并在​​ WM_DESTROY 上终止您的进程.– HHogan 刚刚编辑

Turns out that I answered my own question. Refer to the msdn link above. You must monitor the messages and on WM_DESTROY, you kill your process. – HCHogan just now edit

这篇关于Windows 屏幕保护程序多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆