简体   繁体   English

如何在Windows上获取Active Desktop类型?

[英]How to get the Active Desktop type on windows?

My software (a service coded in cpp) needs to know which desktop is active currently: 我的软件(使用cpp编码的服务)需要知道当前哪个桌面处于活动状态:

  1. Winlogon desktop Winlogon桌面
  2. Application desktop 应用桌面
  3. Screen saver desktop 屏幕保护程序桌面

I have the code for registering WTS_SESSION_CHANGE but that only works when the session is switched. 我有用于注册WTS_SESSION_CHANGE的代码,但仅在切换会话时有效。 Is there any way to know after power-on if the current screen is still WinLogon? 开机后有什么方法可以知道当前屏幕是否仍然是WinLogon?

The purpose of this is to display a Messagebox in the correct desktop through a child process in user mode. 目的是通过用户模式下的子进程在正确的桌面上显示消息框。

得到了解决方案..比较了GetThreadDesktop()和OpenInputDesktop()的名称是否起作用(在用户进程内部)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM