Solved

Proc not in Kill Task menu

Posted on 1999-01-04
3
132 Views
Last Modified: 2010-08-05
How can I prevent, that my app is show in the Ctrl+Alt+Entf menu?
0
Comment
Question by:Shellman
3 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
Comment Utility
hi
here is example

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormDestroy(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}
const
  RSP_SIMPLE_SERVICE = 1;
  RSP_UNREGISTER_SERVICE = 0;

function  RegisterServiceProcess(dwProcessID,dwType : DWORD) : DWORD;
stdcall; external 'KERNEL32.DLL';

procedure TForm1.FormDestroy(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID,RSP_UNREGISTER_SERVICE);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE);
end;

end.


Regards Barry
0
 
LVL 2

Expert Comment

by:gallaghe
Comment Utility
The proposed answer from "inthe" works, but you could add the following to keep the app out of the Windows AppBar:

procedure TForm1.FormCreate(Sender: TObject);
begin
 
  RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE);
  { Add this code to proposed solution }
  ShowWindow(Application.Handle, SW_HIDE);
  SetWindowLong(Application.Handle, GWL_EXSTYLE,GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                WS_EX_TOOLWINDOW );
  ShowWindow( Application.Handle, SW_SHOW );


end;
0
 

Author Comment

by:Shellman
Comment Utility
Thanks, but my exe doesn't have a form.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now