M
Markus
Guest
Hello,
it seems like a simple question but we have major problems identifying, if
our application runs in the console session or in a "normal" terminal
services session.
Using GetSystemMetrics with SM_REMOTESESSION fails, as it will give us
always 1 if we connect to Server 2003 via mstsc. This is in clear
contradiction to the documentation:
--
SM_REMOTESESSION
This system metric is used in a Terminal Services environment. If the
calling process is associated with a Terminal Services client session, the
return value is nonzero. If the calling process is associated with the
Terminal Server console session, the return value is 0. The console session
is not necessarily the physical console. For more information, see
WTSGetActiveConsoleSessionId.
--
Testing for SessionId 0 seemed to work in Server 2003, but not in Longhorn,
where even the physical console can have a sessionid other than 0.
Has anyone any idea how to solve this?
Nice regards,
Markus
it seems like a simple question but we have major problems identifying, if
our application runs in the console session or in a "normal" terminal
services session.
Using GetSystemMetrics with SM_REMOTESESSION fails, as it will give us
always 1 if we connect to Server 2003 via mstsc. This is in clear
contradiction to the documentation:
--
SM_REMOTESESSION
This system metric is used in a Terminal Services environment. If the
calling process is associated with a Terminal Services client session, the
return value is nonzero. If the calling process is associated with the
Terminal Server console session, the return value is 0. The console session
is not necessarily the physical console. For more information, see
WTSGetActiveConsoleSessionId.
--
Testing for SessionId 0 seemed to work in Server 2003, but not in Longhorn,
where even the physical console can have a sessionid other than 0.
Has anyone any idea how to solve this?
Nice regards,
Markus