Hello

I've got big progblems with the shutdown of windows and my EXEs.

My Source:
Code:
(...)
 private
    { Private declarations }
    procedure WMQueryEndSession(var Msg : TWMQueryEndSession); message WM_QueryEndSession;
    procedure WMEndSession(var Msg: TWMEndSession); message WM_ENDSESSION;

(...)

procedure Ttrafficdetector_form.WMQueryEndSession(var Msg : TWMQueryEndSession);
begin
Msg.Result := 1;
options.allow_close := true;
trafficdetector_form.memo2.lines.add('WMQueryEndSession-a');
end;

procedure Ttrafficdetector_form.WMEndSession(var Msg: TWMEndSession);
begin
trafficdetector_form.memo2.lines.add('WMEndSession-a');
options.allow_close := true;
  inherited;
end;

procedure Ttrafficdetector_form.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
trafficdetector_form.memo2.lines.add('FormCloseQuery');
canclose := options.allow_close;
end;

(...)
So. This code is in two of my EXEs. In one EXE it's all right. But on the oter exe Windows won't shut down.

In "Memo2" is "WMQueryEndSession-a" and "WMEndSession-a" but NOT "FormCloseQuery" WHY? Here MUST be "FromCloseQuerry" too, but isn't...

If I remove the WMEndSession it's the same.
If I remove the WMQuerryEndSession first the "FormCloseQuerry" runs and the EXE will not shut down. Then the WMEndSession runs. But Windows won't shut downs :-/

If I remove both WM's the FormCloseQurry runs, but the exe won't shut down (correct, cause can_close).

But if there is the WNQuerryEndSession nothings works... Why?

In all other EXE's it's no problem. Only in this... But the Source is 1200 MB cause I can't write a news EXE...

gotta go
Dennis