Solved

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

Posted on 2008-10-09
9
1,054 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:davizinx
ID: 22682224
god, forget what I said above.
0
 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 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