홈 · 개발 참고자료

개발 참고자료

[파워빌더] Detect if user is using Terminal Server

작성자
관리자
작성일
2016-10-16
조회
10182
분류
파워빌더
[external function declaration]
FUNCTION Integer GetSystemMetrics (Integer nIndex) LIBRARY "user32.dll"


[powerscript]
integer SM_REMOTESESSION = 4096 // remote session
integer SM_REMOTECONTROL = 8193 // remote control

IF GetSystemMetrics(SM_REMOTESESSION)> 0 THEN
// on terminal server
END IF

Another way is to check the Windows environment variable sessionname. The value of this environment variable will be 'Console' for a normal, local session. For an Remote Desktop session it will contain the phrase 'RDP'.ContextKeyword lcxk_base
string ls_Path
string ls_values[]

this.GetContextService("Keyword", lcxk_base)
lcxk_base.GetContextKeywords("sessionname", ls_values)

MessageBox("", ls_values[1])