Board index » delphi » ! Help on hiding program from the task bar !!!

! Help on hiding program from the task bar !!!

Hi,

    I would like to know if someone knows how to hide our program from the Task Bar.

    I would like to do it just like the Control Panel Applets do it.

    Thank you in advance.

    Filipe

    Filipe.Rosado.Fons...@usa.net

    P.S. Please, email me too !

 

Re:! Help on hiding program from the task bar !!!


Filipe <Filipe.Rosado.Fons...@usa.net> wrote in article
<6l3opq$68...@utl2.reitoria.utl.pt>...
Hi,

    I would like to know if someone knows how to hide our program from the
Task Bar.

    I would like to do it just like the Control Panel Applets do it.

etc......

Here are some tips on it from "Delphi 2 Developer's Guide", 2nd Ed., SAMS
publishing. I suggest you order the book, or others like it, because it is
simply
full of good information and hints.  No, I don't work for SAMS.

I'll give you some directions to move in, but please realize there is a lot
of information in the book and I can not retype it all...if you get a hold
of the book it starts on page 490.

Only API call for tray apps (I have not tested this stuff, though I intend
to for one of my projects):  

function Shell_NotifyIcon(dwmessage: dword; lpdata: PNotifyIconData): bool;
stdcall;

dwMessage:
NIM_ADD (val 0) add an icon to notification tray.
NIM_MODIFY (val 1) Modify the properties of an exisitng icon.
NIM_DELETE (val 2) Remove icon from tray

lpDATA is pointer to TNotifyIconData:

type
 TnofiyIconData = record
  cbSize: dword;
  Wnd: Hwnd;
  uID: Uint;
  uFlags: Uint;
  ucallbackMessage: Uint;
  hIcon: Hicon;
  sztip: array[0..63] of AnsiChar;
 end;

uID is programmer defined uniquie ID.  If several icons each needs an ID.

uFlags should be in API help.

ucallbackmessage contains value of Windows message to be sent to the window
ID'd by the WND field.  "Generally, the value of this field is obtained by
calling RegisterWindowMessage() or by using a [sic] an offset from
WM_USER."  Lparam of the message will be same value as UID field, and
wparam will hold the mouse message from the tray icon.

This, I hope, will get you started.  The book suggest subclassing the
window procedure of the owning form to handle the messages from the tray
icon, but there are also other ways.  And for handling mouse clicks the
book says "The challenge comes in creating an event that represents the
double-click without also firing the single-click event."  They suggest
creating a timer on the fly and setting the interval to the systems double
click time.  Then you can cleverly tell the difference between the type of
click.

The last major issue is whether the application will also reside on the
task bar, simply use ShowWindow API to set this as desired.

HTH.

Re:! Help on hiding program from the task bar !!!


You need to hide your mainform and also your application task. you can do this with the API function ShowWindow.

eg.

procedure TMainForm.HideApp;
begin
  ShowWindow(MainForm.Handle,SW_HIDE);
  ShowWindow(Application.Handle,SW_HIDE);
end;

procedure TMainForm.ShowApp;
begin
  ShowWindow(Application.Handle,SW_RESTORE);
  ShowWindow(MainForm.Handle,SW_RESTORE);
  Application.Restore;
  Activate;
end;

rgs
marc
    Filipe schrieb in Nachricht <6l3opq$68...@utl2.reitoria.utl.pt>...
    Hi,

        I would like to know if someone knows how to hide our program from the Task Bar.

        I would like to do it just like the Control Panel Applets do it.

        Thank you in advance.

        Filipe

        Filipe.Rosado.Fons...@usa.net

        P.S. Please, email me too !

Re:! Help on hiding program from the task bar !!!


use
  ShowWindow(Application.Handle, SW_HIDE);
to hide program from the taskbar and
  ShowWindow(Application.Handle, SW_SHOW);
to...precisely, to show your app on the taskbar.

gr. Marcel

Quote
Filipe wrote in message <6l3opq$68...@utl2.reitoria.utl.pt>...

    Hi,

        I would like to know if someone knows how to hide our program from
the Task Bar.

        I would like to do it just like the Control Panel Applets do it.

        Thank you in advance.

        Filipe

        Filipe.Rosado.Fons...@usa.net

        P.S. Please, email me too !

Re:! Help on hiding program from the task bar !!!


If I'm not mistaken, there is a new property on the Application object
called ShowMainForm.  You can simply set that to false  (e.g.
Application.ShowMainForm := False;).  The application object is
automatically instantiated and available to you.
    Filipe wrote in message <6l3opq$68...@utl2.reitoria.utl.pt>...
    Hi,

        I would like to know if someone knows how to hide our program from
the Task Bar.

        I would like to do it just like the Control Panel Applets do it.

        Thank you in advance.

        Filipe

        Filipe.Rosado.Fons...@usa.net

        P.S. Please, email me too !

Re:! Help on hiding program from the task bar !!!


Quote
> Filipe <Filipe.Rosado.Fons...@usa.net> wrote in article
> <6l3opq$68...@utl2.reitoria.utl.pt>...
> Hi,

>     I would like to know if someone knows how to hide our program from
the
> Task Bar.

>     I would like to do it just like the Control Panel Applets do it.

> etc......

Simply hide the system menu. See form's bordericons property.
For application? Destroy the application object or application.handle and
do your own message loop or modify forms.pas or... use OWL.

--
-------------------------
Regards,
Robert

Remove both qwe when replying.
MailTo: robert.qwece...@eunet.qwe.si

Re:! Help on hiding program from the task bar !!!


In article <01bd8f11$03c4ff60$LocalHost@266>, rahnman@What_The.com says...

Quote

>Filipe <Filipe.Rosado.Fons...@usa.net> wrote in article
><6l3opq$68...@utl2.reitoria.utl.pt>...
>Hi,

>    I would like to know if someone knows how to hide our program from the
>Task Bar.

>    I would like to do it just like the Control Panel Applets do it.

>etc......

>Here are some tips on it from "Delphi 2 Developer's Guide", 2nd Ed., SAMS
>publishing. I suggest you order the book, or others like it, because it is
>simply
>full of good information and hints.  No, I don't work for SAMS.

[snip]

Quote
>HTH.

I have a working Delphi 3 program demonstrating the use tray icons. I will
Email it to interested programmers.

--
Christo Crause
Thermal Separations Research
University of Stellenbosch
South Africa

Other Threads