Languages :: Visual Basic :: GetSystemMetrics SM_REMOTECONTROL |
|||
| By: viztopiaman |
Date: 13/06/2007 13:17:06 |
Points: 20 | Status: Answered Quality : Excellent |
| When running a Remote Desktop Session and making the call GetSystemMetrics(SM_REMOTESESSION) it correctly returns a value of 1. However, as I sometimes need to know whether a session is a Remote Desktop one as distinct from a general Terminal Services one I make the call GetSystemMetrics(SM_REMOTECONTROL) but it incorrectly returns a value of 0 even though it should return 1. I don't understand why I can't get this to work especially as I'm fairly sure I tried this a while back (maybe pre: XP SP2) and I think it used to work. | |||
| By: VGR | Date: 13/06/2007 17:54:38 | Type : Answer |
|
| well, sadly it seems that it is necessary to use 3 different methods to detect system login - one for Win 95/98/NT4, one for Win2000 and one for XP - WTSRegisterSessionNotification/WM_WTSSESSION_CHANGE only works with XP (NT 5.1) GetSystemMetrics(SM_REMOTESESSION) only works for Win 95/98/NT4 I don't remember right now the one for Win2K (NT 5.0) You could also Check out this library: wtsapi32.dll or search at msdn.microsoft.com for 'IsTerminalServicesEnabled'. There you can get loads of information regarding (1) Is TNS enabled on this computer (2) Is this application running under TNS (3) The terminal server session Please note also that the OS may have its part in your problem : GetSystemMetrics(SM_REMOTECONTROL) is not supported by citrix |
|||
| By: viztopiaman | Date: 13/06/2007 18:13:44 | Type : Comment |
|
| Thanks for the reply. I appreciate what you're saying. My problem is when I make the call GetSystemMetrics(SM_REMOTESESSION) on a Remote Desktop session it correctly returns the value of 1. At this point I know that it can be either a Citrix, Terminal Services or Remote Desktop session but I need to know specifically if it is Remote Desktop, hence, the reason why I am making the GetSystemMetrics(SM_REMOTECONTROL) call which doesn't work. I can't see that any of the other methods provide Remote Desktop related information consequently I'm stuck. It's odd though that SM_REMOTESESSION works and SM_REMOTECONTROL doesn't. | |||
| By: VGR | Date: 13/06/2007 20:37:31 | Type : Comment |
|
| It's sad, but I think there is no universal solution to your prolem. It's windows ® ;-)) if you can narrow the list of OSes involved, you could perhaps help me think of a solution. |
|||
| By: viztopiaman | Date: 14/06/2007 09:14:28 | Type : Comment |
|
| Don't know about w2k but it goes wrong on Vista too! | |||
| By: VGR | Date: 14/06/2007 14:06:18 | Type : Comment |
|
| not surprising... moreover, if you encounter this problem on Vista and you use onyl Vista, then you're probably on your own. You're the pioneer of this problem on Vista ;-) if you use winXP, there are probably solutions. Sorry not to be able to solve the issue. I can think of possible ways to exploit, though ; if you could install an executable on each client machine, you could probably retrieve some environment variables telling you what the type of connection it is. |
|||
| By: OpConsole | Date: 04/07/2007 16:56:08 | Type : Comment |
|
| do you have more error feedback ? you can also ask us to Close the Question. or.... If you found some of the above comments to have proved helpful in solving your issue, you shall Accept the Answer or sPlit points between the various useful comments. Each one can receive a quality evaluation from + (somewhat helpful) to +++ (working solution). |
|||
| By: OpConsole | Date: 01/11/2007 16:15:16 | Type : Comment |
|
| Dear, If you found some of the above comments to have proved helpful in solving your issue, you shall Accept the Answer or sPlit points between the various useful comments. Each one can receive a quality evaluation from + (somewhat helpful) to +++ (working solution). Given this Question has been Open for quite a while now, please accordingly "accept an Answer" ASAP This Question will be randomely force-closed in one month from now. Thanks and regards. Admin. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








