🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #114050

[dialog] onshutdown

#114050
From: matija
Date: Fri, 08 Nov 2002 19:12
56 lines
2348 bytes
the mailing list wasn't really helpful, so i'll ask here :)


anyone have an idea on how to override dialog's shutdown?
here's what i whipped up:


---

program OnShutdown;

const MB_YESNO = 4; 
      IDYES = 6;
      IDNO = 7;

function MessageBox(hWnd: longword; lpText, lpCaption: PChar; uType: longword): Integer; external 'MessageBoxA@user32.dll stdcall';

procedure OnShutdown;
begin
  if (MessageBox(null, 'Do you want to close Dialog?', 'Close Dialog?', MB_YESNO) = IDYES)
    then 
    else;
end;

begin
end.

---


i need to return a value somehow. delphi has this event for forms:


type TCloseQueryEvent = procedure(Sender: TObject; var CanClose: Boolean) of object;
property OnCloseQuery: TCloseQueryEvent;


so if you want to ask the user if he wishes to close the application,


procedure mainAppForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  if MessageDlg('Exit?', mtConfirmation, [mbOk, mbCancel], 0) = mrCancel then
     CanClose := False;
end;


the question is: how to accomplish the same thing in dialog?


-- 
there is a cheer. the gnomes have learned a new way to say hooray.   [-shpongle]

address is scrambled - remove SPAMISEVIL to reply
Technical Details
Message-ID: <6jwsib1yw337$.dlg@shpongle.604>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!fu-berlin.de!carnet.feed!CARNet.hr!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <6jwsib1yw337$.dlg@shpongle.604>
Subject: [dialog] onshutdown
Date: Fri, 8 Nov 2002 20:12:01 +0100
From: matija <mSkPrAnMic@jaIgSor.srEcVe.IhLr>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!fu-berlin.de!carnet.feed!CARNet.hr!not-for-mail
Newsgroups: news.software.readers
Organization: 604
Lines: 55
NNTP-Posting-Host: a1968.cmu.carnet.hr
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: bagan.srce.hr 1036782719 10845 193.198.144.48 (8 Nov 2002 19:11:59 GMT)
X-Complaints-To: abuse@carnet.hr
NNTP-Posting-Date: 8 Nov 2002 19:11:59 GMT
X-Face: "7>Vm?rO.@qh|TIsbG@X7>asBJ8BSLKs%T@Wd+qgN<P?}[3`e1(M~;NT:f=hn#iN:nyAWyT fR9pPzc9ON|MqY_5Fvk)9[+7Lu!%Ihw.GS]KBQF6K_Vn1J2sB{Ne@3Fa5G-z
User-Agent: 40tude_Dialog/2.0.2.1