确定程序是否在远程桌面上运行 [英] Determine if a program is running on a Remote Desktop

查看:141
本文介绍了确定程序是否在远程桌面上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序是否可以确定何时在远程桌面(终端服务)上运行?

Is there a way my program can determine when it's running on a Remote Desktop (Terminal Services)?

当程序在远程桌面会话上运行时,我想在该程序上启用不活动超时".由于臭名昭著的原因是用户未打开远程桌面会话,因此我希望程序在指定的不活动时间后终止.但是,我不希望为非RD用户启用不活动超时.

I'd like to enable an "inactivity timeout" on the program when it's running on a Remote Desktop session. Since users are notorious for leaving Remote Desktop sessions open, I want my program to terminate after a specified period of inactivity. But, I don't want the inactivity timeout enabled for non-RD users.

推荐答案

GetSystemMetrics(SM_REMOTESESSION)(如 http://msdn.microsoft.com/en-us/library/aa380798.aspx )

GetSystemMetrics(SM_REMOTESESSION) (as described in http://msdn.microsoft.com/en-us/library/aa380798.aspx)

这篇关于确定程序是否在远程桌面上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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