Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1063
  • Last Modified:

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

Hi,

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

thanks in advance.
0
davizinx
Asked:
davizinx
  • 4
  • 2
  • 2
  • +1
3 Solutions
 
SteveBayCommented:
It look like logoff activity is pretty well explain here:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20525770
0
 
davizinxAuthor Commented:
SteveBay:
when i try go to your link:
show this message:
Zone Not Found
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
davizinxAuthor Commented:
god, forget what I said above.
0
 
ChristianWimmerCommented:
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
 
davizinxAuthor Commented:
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
 
ChristianWimmerCommented:
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
 
TheRealLokiCommented:
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
 
davizinxAuthor Commented:
good
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now