Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to diable ALT-F4 in win95

Posted on 1998-02-24
1
Medium Priority
?
152 Views
Last Modified: 2010-04-06
Hi,
How to disable the Alt-F4 from terimating the program in win95 ?
from
hl ding
0
Comment
Question by:dhl
1 Comment
 
LVL 5

Accepted Solution

by:
inter earned 200 total points
ID: 1359766
This is how I do it in Delphi 2.0. You can close the prog from taskbar-rightclick-close but not via ALT-F4

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
    KeyedClose : boolean;
  end;

var
  Form1: TForm1;

implementation

uses database, mainfrm;

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  KeyedClose := True;
end;

procedure TForm1.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
 CanClose := KeyedClose;
 KeyedClose := True;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  KeyedClose := True;
  if ssAlt in Shift then
    if (Key and vk_F4) <> 0 then
       KeyedClose := False;
end;

end.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 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