c# - How to capture logoff cancelled in windows server 2003 -


i'm working on terminal services based system running on windows 2003. consists of desktop replacement application user starts programs. has logoff-button. when user logs off 2 things must happen. first off, logged out of windows. stored procedure called cleaning users database state. works fine, 1 situation, , when user cancels logoff event. typical scenario: 1- user logs in, starts ms word, edits document, not save. 2 - user presses logoff button. 3- ms word reacts asking user save changes. 4 - user presses cancel.

at point desktop application might have called stored procedure cleaning database state. how catch behaviour in desktop application? there message saying end session operation cancelled?

does question make sense @ all?

oh, of applications written in delphi 7, work in c, c++ , c# well, answers in languages appreciated well.

if user state logic inside shell replacement think of application redesign: decouple custom shell session management.

for example: move user state logic in service. within service register rds notifications: wts_session_logon/wts_session_logoff.

i think wts_session_logoff sent only when actual logoff occurs i.e. if user clicks cancel button in word windows know user hasn't logged off , os not send wts_session_logoff (this untested, sounds logical).

this way don't deal wm_endsession/wm_queryendsession stuff.

recently wrote guidance on rds notifications topic.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -