Hi,
A while back (on the fw news groups), I asked about detecting terminal server sessions.
I got an answer, which I've now lost, and I can't seem to connect to the news server anymore (Is there a browsable backup)
So I'm asking again: How can I detect whether I'm in a terminal server session?
Alex
Terminal server session
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Sorry but it seems that the only occurrence of OS_ISWTSCLIENT() in che current xHarbour CVS is
EMG
Code: Select all
FUNCTION OS_ISWTSCLIENT()
RETURN( .F. )
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
Terminal server
Hi,
Thanks for that.
I'm also trying out WTSQuerySessionInformation for the client's ip address, but dont' seem to come right (c is not my strong point).
Below a snippet of my attempt.
#pragma begindump
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>
#ifdef __FLAT__
#include <ShellApi.h>
#endif
#ifdef __HARBOUR__
#include <hbapiitm.h>
#include <hbdate.h>
#include <hbset.h>
#endif
#include "wtsapi32.h"
LPWSTR AnsiToWide( char * );
HB_FUNC( GETIPADDRESS )
{
BOOL bReturn;
WTS_CLIENT_ADDRESS *ClientAddress;
DWORD BytesReturned;
bReturn = WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, 16384, (char * *) ClientAddress, &BytesReturned);
}
#pragma enddump
Thanks for that.
I'm also trying out WTSQuerySessionInformation for the client's ip address, but dont' seem to come right (c is not my strong point).
Below a snippet of my attempt.
#pragma begindump
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>
#ifdef __FLAT__
#include <ShellApi.h>
#endif
#ifdef __HARBOUR__
#include <hbapiitm.h>
#include <hbdate.h>
#include <hbset.h>
#endif
#include "wtsapi32.h"
LPWSTR AnsiToWide( char * );
HB_FUNC( GETIPADDRESS )
{
BOOL bReturn;
WTS_CLIENT_ADDRESS *ClientAddress;
DWORD BytesReturned;
bReturn = WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, 16384, (char * *) ClientAddress, &BytesReturned);
}
#pragma enddump
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
Detect terminal server session alternative
#define SM_REMOTESESSION 4096
IF GetSysMetrics( SM_REMOTESESSION ) <> 0
MsgAlert("On a Remote TS Session")
endif
IF GetSysMetrics( SM_REMOTESESSION ) <> 0
MsgAlert("On a Remote TS Session")
endif