Intercept client attempt to disconnect??

M

MiFe

Does anyone know how to intercept a Terminal Service Client attempt to
disconnect??

The reason:
When a disconnect is attempted, I want to check to be sure a specific
application is not left running. However, I can not just End the
application process abruptly, because it will leave data open. Ideally, I
would like to send a message at this point saying "You must close X
application before disconnecting/ending this session."

This application uses a database, and I need to be sure this user is logged
out, otherwise another user may be restricted access to performing certain
functions.

From,
Sort-of-New-Terminal-Services-Guy
 
I

Ivan Leichtling [MSFT]

Are you the developer of the database application? You can make your
application TS aware and monitor for session disconnections and
logoffs. See WTSRegisterSessionNotification in MSDN.

http://msdn.microsoft.com/library/d...v/termserv/wtsregistersessionnotification.asp

If you register for the WTS_REMOTE_DISCONNECT and/or the
WTS_SESSION_LOGOFF, you can close the database at that point.




Does anyone know how to intercept a Terminal Service Client attempt to
disconnect??

The reason:
When a disconnect is attempted, I want to check to be sure a specific
application is not left running. However, I can not just End the
application process abruptly, because it will leave data open. Ideally, I
would like to send a message at this point saying "You must close X
application before disconnecting/ending this session."

This application uses a database, and I need to be sure this user is logged
out, otherwise another user may be restricted access to performing certain
functions.

From,
Sort-of-New-Terminal-Services-Guy

This posting is provided "AS IS" with no warranties, and confers no rights
 
M

MiFe

Thank you Ivan.
I will pass this information on to our lead developer.
I noticed that this Terminal Services API is contained in the wtsapi32.dll.
I tried adding this to a vb project, but I can not....Is this API not
available in the vb??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top