|
Optimizing Applications for Windows 2000 Terminal Services and Windows nt server 0
|
bet | 48/49 | Sana | 29.03.2021 | Hajmi | 197,5 Kb. | | #13691 |
Detecting If an Application Is Running in a Console Session or Remote Session.
This code can be used to detect what type of Terminal Services session the application execution request is being initiated from. The Windows 2000 operating system or Service Pack 4 for Windows NT Server 4.0, Terminal Server Edition is required. On all other Win32 platforms, this code will always indicate that the process is running on the console. The following code is compatible with all Win32 platforms, however, the SM_REMOTESESSION value (defined in WINUSER.H) is only defined when you compile with a WINVER value >= 5.0.
if (GetSystemMetrics(SM_REMOTESESSION))
{
// App is running on a remote session.
} else {
// App is running on the console.
}
|
| |