Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hide application from Alt+Tab,taskbar,and Ctrl+Alt+Del

257 views
Skip to first unread message

dk

unread,
May 5, 2003, 3:08:18 AM5/5/03
to
Hi all,
Delphi 5, WinXP
How to hide application from taskbar, Alt + Tab, and Applications Page in
Task Manager?
But I don't want to hide the form.

I use this proc in Win98

procedure TForm1.Button1Click(Sender: TObject);
begin
ShowWindow(Application.Handle,SW_Hide);
//Form1.Hide;
RegisterServiceProcess(0,1);
if (RegisterServiceProcess(0,1)<>1) then
MessageDlg('Cannot hide process ',mtError,[mbOK],0);
end;

The form still can be seen from Alt+Tab. Indeed, I can hide it from Alt +
Tab by activating the
second line but I will loose my form too.Don't ask me to change the Form's
borders style to bsToolWindow.

This proc doesn't work in WinXP! How to register a service process in WinXP?

Example code will be appreciated very much.
Thanks for helping


Filip Poverud

unread,
May 5, 2003, 3:43:37 AM5/5/03
to

>How to hide application from taskbar, Alt + Tab, and >Applications Page in Task Manager?

The only way of really hiding a process will result in a virus warning, besides there is no good reasons for doing it.

---

with Regards

/Filip

Charles Hacker

unread,
May 5, 2003, 8:49:45 PM5/5/03
to
Filip Poverud wrote:
>
> >How to hide application from taskbar, Alt + Tab, and >Applications Page in Task Manager?
>
> The only way of really hiding a process will result in a virus warning, besides there is no good reasons for doing it.

There are valid reasons for it.
(I use a hidden app as a watchdog app, to trap and stop students running
games in the student computer lab).

One technique is to use the code below:

Use it in the *.dpr right before Application.Initialize

ShowWindow(Application.Handle, SW_HIDE );
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE) or
WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);

If the above is not sufficient, making the app a 'Service' may work.

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;

--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia

Zarko Gajic <http://delphi.about.com>

unread,
May 6, 2003, 9:20:43 AM5/6/03
to
Hi

Here's a possible answer:

http://delphi.about.com/library/weekly/aa012103a.htm

.............................................
Zarko Gajic, BSCS
About Guide to Delphi Programming
http://delphi.about.com
email: delphi...@about.com
free newsletter: http://delphi.about.com/library/blnewsletter.htm
forum: http://forums.about.com/ab-delphi/start/
advertising: http://delphi.about.com/library/bladvertise.htm
.............................................

"dk" <drea...@yahoo.com.sg> wrote in message
news:3eb6...@newsgroups.borland.com...

Filip Poverud

unread,
May 8, 2003, 3:56:30 AM5/8/03
to

Fully agreed, but this is a legal way of hiding it from the native tools on the OS, a small piece of code, and it's visible.

---

with Regards

Filip Poverud

0 new messages