Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

action before shutdown

Posted on 1998-10-27
11
Medium Priority
?
185 Views
Last Modified: 2010-04-06
My program is 'running' in background
I still want to perform a procedure just before my computer shuts down.
When I put it with
onclose->nothing
ondestroy->sometimes when rebooting
free(redefined)->nothing
release(redefined)->nothing
So, what do I have to do

PS: if this makes it harder? -> I still want to copy a file
0
Comment
Question by:zwarte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 1

Accepted Solution

by:
jecksom earned 200 total points
ID: 1344593
Hi , zwarte!

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
    procedure WM_ENDSESSION(var msg:TMSG);message WM_ENDSESSION;

    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure Tform1.WM_ENDSESSION(var msg:TMSG);
begin
showmessage('End session');
end;

end.

Jecksom

0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1344594
zwarte

put it in your onclosequery event...

example

begin
 canclose := false;
  Copyfile('c:\autoexec.bat', 'c:\temp\autoexec.bat', false');// false is to override the file if it is already in the directory...
   CanClose := True;
end;

Later
BoRiS
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344595
zwarte, who are you? If I may ask... I know somebody who calls hime like that.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:jecksom
ID: 1344596
Hi Boris !

My answer doesn't work ? ;)

cya,
Jecksom

0
 
LVL 1

Author Comment

by:zwarte
ID: 1344597
It took a while for me to check this one out but I had a logical mistake somewhere else in the program.
Your answer however works just fine.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344598
zwarte, I still would really like who you are, or from where you are , please....
0
 
LVL 1

Author Comment

by:zwarte
ID: 1344599
To Zifnab

From Leuven, so I don't think I'm your guy
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344600
zwarte, maybe you are. I studied in Leuven and now work in Leuven. Zif. What do you studie or have studied?
0
 
LVL 1

Author Comment

by:zwarte
ID: 1344601
Informatics,
but I Usually don't use the name zwarte
It was the first name that allowed me acces to experts exchange 'cause I was trying to get in with a hotmail adress(this doesn't work), and when I  finally tried my company adres I got in, but under the name of zwarte.
I do however know a guy that went by the name of Zwarte Fons, but not just zwarte
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344602
Well, then your not the guy I know of. Pitty, because we've lot's to discuss. The guy I know calls him Black, but I thought he maybe changed it to zwarte.
Have a nice day and thanks for responding.
0
 
LVL 1

Author Comment

by:zwarte
ID: 1344603
Your welcome
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

604 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