Solved

how to detect when is made logoff and perform an action?

Posted on 2008-10-09
9
1,052 Views
Last Modified: 2010-04-21
Hi,

how to detect when is made logoff and perform an action?
or its not possible ?

thanks in advance.
0
Comment
Question by:davizinx
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:SteveBay
ID: 22682183
It look like logoff activity is pretty well explain here:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20525770
0
 
LVL 14

Assisted Solution

by:SteveBay
SteveBay earned 200 total points
ID: 22682196
0
 

Author Comment

by:davizinx
ID: 22682214
SteveBay:
when i try go to your link:
show this message:
Zone Not Found
0
 

Author Comment

by:davizinx
ID: 22682224
god, forget what I said above.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Assisted Solution

by:ChristianWimmer
ChristianWimmer earned 20 total points
ID: 22682662
Some problems here:
1. Winlogon Notification Packages are not supported in Windows Vista.
2. WTSRegisterSessionNotification cannot be used in a service since it uses Window messages which are blocked over session barriers.
3. RegisterServiceCtrlHandlerEx/HandlerEx could be used if TService implementation would allow it. However if you write your own service implementation this can be an option. (Some problems exists in Windows 2000)

However SENS COM API can be a good option. (https://jedi-apilib.svn.sourceforge.net/svnroot/jedi-apilib/jwapi/branches/2.2a/Examples/SENS/WinLogonLogo/)
0
 

Author Comment

by:davizinx
ID: 22688778
ChristianWimmer:
Your example is missing several files .dcu
-
SteveBay:
It seems to be what I want, but because I understand little English could not do what he wanted and fully understand.
 could make a ready example of what I want?
Thanks in advance.
0
 
LVL 6

Expert Comment

by:ChristianWimmer
ID: 22688983
The example is using the JEDI API Windows Headers that are also available here: blog.delphi-jedi.net
I just pointed to the subversion repository. If you download the sources you'll also get the examples.
0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 280 total points
ID: 22698765
don't you just capture the wm_QueryEndSession message?
e.g.

private
  procedure WMQueryEndSession(var Msg : TWMQueryEndSession) ; message WM_QueryEndSession;


...
procedure TForm1.WMQueryEndSession(var Msg : TWMQueryEndSession) ;
begin
// If you want to stop the log off/ shut down do the next line
//   Msg.Result := 0
// otherwise, except that we are logging off/ shutting down
  // do any clean up you want here then do the folllowing
   Msg.Result := 1 ;
end;
0
 

Author Closing Comment

by:davizinx
ID: 31504819
good
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
Downloading email attachments 2 67
Delphi IDE crash without error message ... 7 76
Firemonkey DbLookupComboBox equivalent ? 2 38
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now