Terminal server session

Terminal server session

Postby AlexSchaft » Mon Jun 05, 2006 6:59 am

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
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby James Bott » Mon Jun 12, 2006 4:18 pm

Alex,

I searched all my offline copies of the old forums for both "terminal" and "Alex" and I couldn't find anything. However, my copies are not complete. Sorry I couldn't be of any help.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Gale FORd » Mon Jun 12, 2006 8:01 pm

In xHarbour

IF OS_ISWTSCLIENT()
? "Running as a Windows Terminal Server Client"
ELSE
? "NO Windows Terminal Server Client detected"
ENDIF
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby Enrico Maria Giordano » Mon Jun 12, 2006 9:33 pm

Sorry but it seems that the only occurrence of OS_ISWTSCLIENT() in che current xHarbour CVS is

Code: Select all  Expand view
FUNCTION OS_ISWTSCLIENT()
  RETURN( .F. )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Gale FORd » Mon Jun 12, 2006 11:13 pm

Enrico,

Were you responding to me?
I am using this funcion in xHarbour Builder with and without Fivewin.
Our configuration include Citrix and Lan users.

Thanks,
Gale
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby Enrico Maria Giordano » Tue Jun 13, 2006 9:03 am

Sorry, my fault! I missed the real definition in the same source code.

I apologize.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Terminal server

Postby AlexSchaft » Wed Jun 14, 2006 2:38 am

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
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Detect terminal server session alternative

Postby AlexSchaft » Wed Jun 21, 2006 7:14 am

#define SM_REMOTESESSION 4096

IF GetSysMetrics( SM_REMOTESESSION ) <> 0
MsgAlert("On a Remote TS Session")
endif
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby concentra » Sat Jan 13, 2007 9:47 pm

Davide, did you have success in getting the IP address of the TS client ?

Maurício Faria
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests