Security Program

I am working on a program that stops people from accessing your computer while you have gone out of the room for a coffie break. The program i have already wrote works fine but it stops you from pressing Alt Ctrl And Del to close the program down, if your not sure what i mean download it here: win 95 or 98 it works fine on. Not tested on NT

http://members.xoom.com/craig_c/protect.zip 

But really i want to still be able to use Alt Ctrl And Del, but this time my program does not show up in alt ctrl and del like other programs running in memory, anyone know how to do this?
LVL 2
craig_capelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

andrewsmithCommented:
Use this code

type  TForm1 = class(TForm)    procedure FormCreate(Sender: TObject);  private
    { Private declarations }  public    { Public declarations }  end;
function RegisterServiceProcess(ProcessID, Flag: dWord):Word;
           stdcall; external 'kernel32.dll';{...}
procedure TForm1.FormCreate(Sender: TObject);var  CurrentProccess : DWORD;begin
  // get our applications process ID  CurrentProcess := GetCurrentProcessID();
  // register our process as a kernel32 process
  RegisterServiceProcess(CurrentProcess, 1);end;{...}
0
craig_capelAuthor Commented:
Nope sorry, this code does not seem to work with delphi 4, Its either that or i am doing something wrong.... this is whats giving me the error

type
  TForm1 = class(TForm)
  private
  { Private declarations }
    function RegisterServiceProcess(ProcessID, Flag: dWord):Word;
        stdcall; external 'kernel32.dll';{...}
    public
    { Public declarations }
  end;


That alone gives me 6 errors...

[Error] Unit1.pas(13): Field definition not allowed after methods or properties
[Error] Unit1.pas(17): ',' or ':' expected but 'END' found
[Hint] Unit1.pas(12): Private symbol 'RegisterServiceProcess' declared but never used
[Hint] Unit1.pas(13): Private symbol 'external' declared but never used
[Hint] Unit1.pas(15): Private symbol 'public' declared but never used
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

I have never used DLLs before so, Its more than likely completly wrong
0
RadlerCommented:
At Delphi 4 uses only

unit Blabla

uses Windows, ......, ;

procedure someproc;
    RegisterServiceProcess( 0, 1 );
end;

T++, Radler.
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

_DJ_Commented:
I don't know why you rejected andrewsmith's answer, but he's code will work, unless you are using NT, but why would anyone want a security program for NT, so I guess you're using 95/98 and that andrewsmith deservs the points!


0
craig_capelAuthor Commented:
DJ, I tried his code in DELPHI 4, and it DOES NOT work.... It gives me lots of illegal errors, that one line of code does not even work....

type
                        TForm1 = class(TForm)
                        private
                        { Private declarations }
                          function RegisterServiceProcess(ProcessID, Flag: dWord):Word;
                              stdcall; external 'kernel32.dll';{...}
                          public
                          { Public declarations }
                        end;

I might work fine in delphi 2 or even delphi 3, but i CAN NOT get it to work with delphi4, so then please show me how to edit that one line to make it work with delphi 4 without errors, thanks, I also mentioned it was only to be used with 95 and 98.
0
_DJ_Commented:
Under USES add STDCTRLS

then make this function:

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

Under ONFormCreate make this:

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

That will hide your app from the CTRL+ALT+DEL menu.

If you wish to add it to the menu for some reason again then call:

RegisterServiceProcess(GetCurrentProcessID,0);

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_DJ_Commented:
I used the above code myself in D4 so it will work! :)
0
craig_capelAuthor Commented:
Ok i will belive you, not tested it but it HAS to work :)


Craig C.
0
craig_capelAuthor Commented:
AHHHHHH yes, i just got it!!!! its a standard procedure i was trying to put the code somewhere i should not thankkkkkkkkkkkkkkkkkks.


:) Craig C.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.