Re: Windows shutdown. Get App to notice difference between close and shutdown

"arcadeukcom" <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Hi, 

I have already tried a simular method. 

My problem is that when I have a TForm.FormCloseQuery procedure 
somewhere in the unit, it seems to ignore then WMEndSession procedure 
and just do the CanClose bit

Thanks 

Luke

--- In [email protected], "Rosivaldo Azevedo 
Ramalho" <rosivaldo@d...> wrote:
> Why don't you try to set some kind of flag? It might work.
> 
> i.e:
> procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: 
Boolean);
> begin
>   if bFlagToClose then CanClose := True
>   else { the code for prompt }
> end;
> 
> procedure TMainForm.WMEndSession(var Msg: TWMEndSession);
>  begin
>    if Msg.EndSession = TRUE then begin
>      ShowMessage('Windows is shutting down ' + #13 + 'at ' +
> FormatDateTime('c', Now));
>      bFlagToClose := True;
>   inherited;
> end;
> 
> I hope to help you
> 
> --
> Rosivaldo Azevedo Ramalho
> Decisão Informática
> www.decisaosotf.com.br
> rosivaldo@d...
> +55 83 310 9039


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.