Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il
s'exécute au cours d'une session Terminal Server "vraie" (donc sur une
session locale du serveur). Quelqu'un sait-t'il comment faire ça de
façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
B. Neve
Voici qui devrait t'intéresser... Si tu sais en faire quelquechose, je suis intéressé également...
Je pense que l'API WTSEnumerateSessions de la DLL WTSAPI.DLL devrait faire l'affaire. En effet, voici ce que Bill est dit : You can use the WTSEnumerateSessions function to retrieve the session ID, computer name, and session state
Et plus précisément...
http://support.microsoft.com/kb/291789/en-us
Benoit
"smrhp" a écrit dans le message de news:
Bonsoir,
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il s'exécute au cours d'une session Terminal Server "vraie" (donc sur une session locale du serveur). Quelqu'un sait-t'il comment faire ça de façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Merci
Voici qui devrait t'intéresser...
Si tu sais en faire quelquechose, je suis intéressé également...
Je pense que l'API WTSEnumerateSessions de la DLL WTSAPI.DLL devrait faire
l'affaire.
En effet, voici ce que Bill est dit :
You can use the WTSEnumerateSessions function to retrieve the session ID,
computer name, and session state
Et plus précisément...
http://support.microsoft.com/kb/291789/en-us
Benoit
"smrhp" <smrhppub-news_@yahoo.fr> a écrit dans le message de news:
mn.a43a7d66ccd7dd31.50968@yahoo.fr...
Bonsoir,
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il
s'exécute au cours d'une session Terminal Server "vraie" (donc sur une
session locale du serveur). Quelqu'un sait-t'il comment faire ça de
façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Voici qui devrait t'intéresser... Si tu sais en faire quelquechose, je suis intéressé également...
Je pense que l'API WTSEnumerateSessions de la DLL WTSAPI.DLL devrait faire l'affaire. En effet, voici ce que Bill est dit : You can use the WTSEnumerateSessions function to retrieve the session ID, computer name, and session state
Et plus précisément...
http://support.microsoft.com/kb/291789/en-us
Benoit
"smrhp" a écrit dans le message de news:
Bonsoir,
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il s'exécute au cours d'une session Terminal Server "vraie" (donc sur une session locale du serveur). Quelqu'un sait-t'il comment faire ça de façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Merci
B. Neve
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il s'exécute au cours d'une session Terminal Server "vraie" (donc sur une session locale du serveur). Quelqu'un sait-t'il comment faire ça de façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Merci
Et encore ceci...
Detecting the Terminal Services Environment
To optimize performance, it is good practice for applications to detect
whether they are running in a Terminal Services client session. For example,
when an application is running on a remote session, it should eliminate
unnecessary graphic effects, as described in Graphic Effects. If the user is
running the application in a console session (directly on the terminal), it
is not necessary for the application to optimize its behavior.
The following code sample shows a function that returns TRUE if the
application is running in a remote session and FALSE if the application is
running on the console. It does not work on Windows NT 4.0 or earlier
releases of Windows NT.
BOOL IsRemoteSession(void)
{
return GetSystemMetrics( SM_REMOTESESSION );
}
"smrhp" <smrhppub-news_@yahoo.fr> a écrit dans le message de news:
mn.a43a7d66ccd7dd31.50968@yahoo.fr...
Bonsoir,
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il
s'exécute au cours d'une session Terminal Server "vraie" (donc sur une
session locale du serveur). Quelqu'un sait-t'il comment faire ça de
façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
Je souhaite pouvoir identifier pour un programme écrit en WD55 s'il s'exécute au cours d'une session Terminal Server "vraie" (donc sur une session locale du serveur). Quelqu'un sait-t'il comment faire ça de façon fiable (genre via une API ou je ne sais quoi d'autres )
Et pouvoir extraire le nom de l'utilisateur connecté ?
Merci
smrhp
B. Neve a pensé très fort :
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
merci ces pistes semblent en effet très intéressantes... De mon côté j'avais trouvé dans la base de registre des entrées dans HKCUVolatile environement qui semblent contenir suffisement d'infos pour répondre à mon problème, mais je vais explorer les pistes que tu donnes. Pas cette semaine car en déplacement, mais si j'y parviens j'allimenterais ce fil avec mes tentatives ;)
B. Neve a pensé très fort :
Et encore ceci...
Detecting the Terminal Services Environment
To optimize performance, it is good practice for applications to detect
whether they are running in a Terminal Services client session. For example,
when an application is running on a remote session, it should eliminate
unnecessary graphic effects, as described in Graphic Effects. If the user is
running the application in a console session (directly on the terminal), it
is not necessary for the application to optimize its behavior.
The following code sample shows a function that returns TRUE if the
application is running in a remote session and FALSE if the application is
running on the console. It does not work on Windows NT 4.0 or earlier
releases of Windows NT.
BOOL IsRemoteSession(void)
{
return GetSystemMetrics( SM_REMOTESESSION );
}
merci ces pistes semblent en effet très intéressantes... De mon côté
j'avais trouvé dans la base de registre des entrées dans HKCUVolatile
environement qui semblent contenir suffisement d'infos pour répondre à
mon problème, mais je vais explorer les pistes que tu donnes. Pas cette
semaine car en déplacement, mais si j'y parviens j'allimenterais ce fil
avec mes tentatives ;)
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
merci ces pistes semblent en effet très intéressantes... De mon côté j'avais trouvé dans la base de registre des entrées dans HKCUVolatile environement qui semblent contenir suffisement d'infos pour répondre à mon problème, mais je vais explorer les pistes que tu donnes. Pas cette semaine car en déplacement, mais si j'y parviens j'allimenterais ce fil avec mes tentatives ;)
Daniel
Bonjour,
smrhp writes:
B. Neve a pensé très fort : > Et encore ceci... Detecting the Terminal Services Environment To >optimize performance, it is good practice for applications to detect >whether they are running in a Terminal Services client session. For >example, when an application is running on a remote session, it >should eliminate unnecessary graphic effects, as described in Graphic >Effects. If the user is running the application in a console session >(directly on the terminal), it is not necessary for the application >to optimize its behavior. The following code sample shows a function >that returns TRUE if the application is running in a remote session >and FALSE if the application is running on the console. It does not >work on Windows NT 4.0 or earlier releases of Windows NT. BOOL >IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); >} > > > Ou encore : Et je pense le mieux.... > > >http://msdn.microsoft.com/library/default.asp?url=/library/en-us/terms erv/termserv/wtsquerysessioninformation.asp >
merci ces pistes semblent en effet très intéressantes... De mon côt é j'avais trouvé dans la base de registre des entrées dans HKCUVolatile environement qui semblent contenir suffisement d'infos pour répondre à mon problème, mais je vais explorer les pistes que tu donnes. Pas cette semaine car en déplacement, mais si j'y parviens j'allimenterais ce fil avec mes tentatives ;)
si c'est uniquement pour savoir si ton application est lancée en mode TSE/RDP ou pas je fais le code suivant
// test si TSE ou pas Xl_sEnvironnment est chaine = ""
Xl_sEnvironnement = SysEnvironnement("clientname") Xl_sEnvironnement = ExtraitChaîne(Xl_sEnvironnement, 2, "=") SI Xl_sEnvironnement<>EOT ALORS XP_RDP=1 // variable projet qui permet de changer le comportement XP_RDP_user=ExtraitChaîne(SysEnvironnement("SESSIONNAME"), 2, "=") FIN
-- suivre ce lien pour répondre: http://cerbermail.com/?2KrV3YZXnn Daniel ;-)
Bonjour,
smrhp <smrhppub-news_@yahoo.fr> writes:
B. Neve a pensé très fort :
> Et encore ceci... Detecting the Terminal Services Environment To
>optimize performance, it is good practice for applications to detect
>whether they are running in a Terminal Services client session. For
>example, when an application is running on a remote session, it
>should eliminate unnecessary graphic effects, as described in Graphic
>Effects. If the user is running the application in a console session
>(directly on the terminal), it is not necessary for the application
>to optimize its behavior. The following code sample shows a function
>that returns TRUE if the application is running in a remote session
>and FALSE if the application is running on the console. It does not
>work on Windows NT 4.0 or earlier releases of Windows NT. BOOL
>IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION );
>}
>
>
> Ou encore : Et je pense le mieux....
>
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/terms erv/termserv/wtsquerysessioninformation.asp
>
merci ces pistes semblent en effet très intéressantes... De mon côt é
j'avais trouvé dans la base de registre des entrées dans HKCUVolatile
environement qui semblent contenir suffisement d'infos pour répondre à
mon problème, mais je vais explorer les pistes que tu donnes. Pas
cette semaine car en déplacement, mais si j'y parviens j'allimenterais
ce fil avec mes tentatives ;)
si c'est uniquement pour savoir si ton application est lancée en mode
TSE/RDP ou pas je fais le code suivant
// test si TSE ou pas
Xl_sEnvironnment est chaine = ""
Xl_sEnvironnement = SysEnvironnement("clientname")
Xl_sEnvironnement = ExtraitChaîne(Xl_sEnvironnement, 2, "=")
SI Xl_sEnvironnement<>EOT ALORS
XP_RDP=1 // variable projet qui permet de changer le comportement
XP_RDP_user=ExtraitChaîne(SysEnvironnement("SESSIONNAME"), 2, "=")
FIN
--
suivre ce lien pour répondre:
http://cerbermail.com/?2KrV3YZXnn
Daniel
;-)
B. Neve a pensé très fort : > Et encore ceci... Detecting the Terminal Services Environment To >optimize performance, it is good practice for applications to detect >whether they are running in a Terminal Services client session. For >example, when an application is running on a remote session, it >should eliminate unnecessary graphic effects, as described in Graphic >Effects. If the user is running the application in a console session >(directly on the terminal), it is not necessary for the application >to optimize its behavior. The following code sample shows a function >that returns TRUE if the application is running in a remote session >and FALSE if the application is running on the console. It does not >work on Windows NT 4.0 or earlier releases of Windows NT. BOOL >IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); >} > > > Ou encore : Et je pense le mieux.... > > >http://msdn.microsoft.com/library/default.asp?url=/library/en-us/terms erv/termserv/wtsquerysessioninformation.asp >
merci ces pistes semblent en effet très intéressantes... De mon côt é j'avais trouvé dans la base de registre des entrées dans HKCUVolatile environement qui semblent contenir suffisement d'infos pour répondre à mon problème, mais je vais explorer les pistes que tu donnes. Pas cette semaine car en déplacement, mais si j'y parviens j'allimenterais ce fil avec mes tentatives ;)
si c'est uniquement pour savoir si ton application est lancée en mode TSE/RDP ou pas je fais le code suivant
// test si TSE ou pas Xl_sEnvironnment est chaine = ""
Xl_sEnvironnement = SysEnvironnement("clientname") Xl_sEnvironnement = ExtraitChaîne(Xl_sEnvironnement, 2, "=") SI Xl_sEnvironnement<>EOT ALORS XP_RDP=1 // variable projet qui permet de changer le comportement XP_RDP_user=ExtraitChaîne(SysEnvironnement("SESSIONNAME"), 2, "=") FIN
-- suivre ce lien pour répondre: http://cerbermail.com/?2KrV3YZXnn Daniel ;-)
smrhp
Il se trouve que B. Neve a formulé :
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
celui-ci fonctionne très bien : appeldll32("user32","GetSystemMetrics",0x1000)
retourne bien 1 lorsqu'on est en contrôle à distance. C'est à dire que si une session est exécutée depuis un poste distant on a 1, si par contre la session est exécutée directement sur la console serveur, elle renvoit 0 (et renvoit 0 bien sûr sur un XP "poste de travail").
Il se trouve que B. Neve a formulé :
Et encore ceci...
Detecting the Terminal Services Environment
To optimize performance, it is good practice for applications to detect
whether they are running in a Terminal Services client session. For example,
when an application is running on a remote session, it should eliminate
unnecessary graphic effects, as described in Graphic Effects. If the user is
running the application in a console session (directly on the terminal), it
is not necessary for the application to optimize its behavior.
The following code sample shows a function that returns TRUE if the
application is running in a remote session and FALSE if the application is
running on the console. It does not work on Windows NT 4.0 or earlier
releases of Windows NT.
BOOL IsRemoteSession(void)
{
return GetSystemMetrics( SM_REMOTESESSION );
}
celui-ci fonctionne très bien :
appeldll32("user32","GetSystemMetrics",0x1000)
retourne bien 1 lorsqu'on est en contrôle à distance. C'est à dire que
si une session est exécutée depuis un poste distant on a 1, si par
contre la session est exécutée directement sur la console serveur, elle
renvoit 0 (et renvoit 0 bien sûr sur un XP "poste de travail").
Et encore ceci... Detecting the Terminal Services Environment To optimize performance, it is good practice for applications to detect whether they are running in a Terminal Services client session. For example, when an application is running on a remote session, it should eliminate unnecessary graphic effects, as described in Graphic Effects. If the user is running the application in a console session (directly on the terminal), it is not necessary for the application to optimize its behavior. The following code sample shows a function that returns TRUE if the application is running in a remote session and FALSE if the application is running on the console. It does not work on Windows NT 4.0 or earlier releases of Windows NT. BOOL IsRemoteSession(void) { return GetSystemMetrics( SM_REMOTESESSION ); }
celui-ci fonctionne très bien : appeldll32("user32","GetSystemMetrics",0x1000)
retourne bien 1 lorsqu'on est en contrôle à distance. C'est à dire que si une session est exécutée depuis un poste distant on a 1, si par contre la session est exécutée directement sur la console serveur, elle renvoit 0 (et renvoit 0 bien sûr sur un XP "poste de travail").