Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to prevent extended close options in your application Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Prevent extended close options in your application 23-Aug-04
Category
Win API
Language
Delphi All Versions
Views
387
User Rating
8
# Votes
1
Replies
0
Publisher:
Bramsing, Leif Steen
Reference URL:
			
If you need to prevent the user to close the appl. from the close-button in the 
form, then you can use Joe F, Darley's way to do so. But you can 
also add this code to prevent [ALT]+[F4] and by right-clik on the appl. in the 
programme-bar.
1   
2     private
3       { Private declarations }
4       OkToClose: Boolean;
5   
6   {In the forms OnCloseQuery event:}
7   procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
8   begin
9     CanClose := OkToClose;
10  end;
11  
12  {And in your own closebutton: ( if you want to have one )}
13  procedure TForm1.CloseProgrammeClick(Sender: TObject);
14  begin
15    OkToClose := True;
16    Close;
17  end;

This way you cannot close the appl. other than if you let the user by your own
 close-button.

Well... There is one way to close it... You can close the appl. by press
 [Ctrl]+[Alt]+[Del] and then close it in progresses or in the Job-list
 for programmes...

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC