Solved

Hide Application From Appearing Both On And Above XP Locked Taskbar

Posted on 2004-09-24
9
215 Views
Last Modified: 2010-04-05
I have created a Delphi 5 SDI application which I am running on Windows XP. I would like to know what steps I need to take to prevent this application from ever appearing on (or above) the XP Taskbar. I do want the application to continue to appear in the ALT-TAB list and in the process list. It is just the TaskBar and the area above it that I am asking about.

My XP Taskbar's appearance is configured as follows:
Lock The TaskBar - Checked
Auto Hide the Taskbar - UNchecked
Keep the Taskbar on top of other windows - Checked
Group similar taskbar buttons - Checked
Show quick launch - Checked

I have found several answers to this specific question on Expert Exchange (typically utilizing SetWindowLong) and have tried implementing them to some degree of success. Where I am getting stuck is when I minimize my application's main form. While the app no longer appears in the TaskBar, it does insist on appearing as a small icon immediately above the TaskBar on the left hand side. I would like to be able to minimize the app and have it not appear in either place.

Thanks,
ilmds123

0
Comment
Question by:ilmds123
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12142310
Do it simple... Turn your application into a system service. Works fine on XP. Just make sure it is set up to be interactive with the desktop or else you'd never se any of it's forms...
0
 
LVL 2

Assisted Solution

by:php4delphi
php4delphi earned 150 total points
ID: 12146031
Add Application.OnMinimize event handler with the following code

ShowWindow(Application.Handle, SW_HIDE);

0
 

Author Comment

by:ilmds123
ID: 12146377
php4delphi,

I tried your suggestion and while it does remove the item from the TaskBar when the app is minimized, it also removes it from the ALT-TAB list. Is there a way to have it just be removed from the TaskBar only? I would like it to remain on the ALT-TAB list. In addition I would like it to always be removed from the TaskBar regardless of whether the app is minimized or not.

ilmds123
0
 

Author Comment

by:ilmds123
ID: 12151089
Workshop_Alex,

Thank you for your response. I've never created a system service application and have just looked at some of the Delphi 5 Help documentation about "Service Applications". Is this the same thing? If so, at initial glance and not knowing all my options (which I realize may be few to none) your suggestion seems like this would require a considerable amount of effort to achieve what would seem to me like something so simple to do - the removal of an item from the XP TaskBar. Again bear in mind that I have never attempted a Service App and don't know what is involved.

1. How often are service apps used as standard types of end user apps (non multi user, non networked, simple data entry apps) which is what my app would be considered?

2. Could you tell me a little more about what would be involved in converting an existing application to a service application?

3. Also is there no other simpler way to a accomplish what I am trying to do?

ilmds123
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 100 total points
ID: 12152420
Yep. The service application. And indeed, it means that you will have a lot of new things to learn. Knowing more about system services is a good thing but if time is a limitation then you need a simpler solution. Still, system services aren't that complicated, once you're familiar with them. The biggest advantage is that they just keep running in the background like TSR applications in the MS-DOS era.

1) Services are, in general, background applications. Often meant to do some important background calculations or communications with hardware and network. But it's also used for e.g. schedulers that just need to wait until a certain thime, then triggers some action. Or for databases like SQL Server or InterBase, where the service is running in the background, to speed up communications between the database on disk and any application trying to connect to it. With SQL Server, for example, you have a separate application that hides as trayicon that communicates with the SQL database service and allows a user interface for the user to configure it. But even if that application is closed, the service keeps running.

2) To convert to a system service, you first have to check if you can separate the business logic from the user interface. The service can still interact with the user though it's GUI, though. Also, when working with services, it helps if you're familiar with multi-threaded programming. It's not required but it helps. There's an important difference with normal applications since it's not a normal application. The TApplication object differs from the normal one. But you can create a form, show it, hide it, close it and release it again, if you want.

3) SetWindowLong is one of the alternatives. But is there a trayicon component in your project?
0
 
LVL 6

Accepted Solution

by:
vadim_ti earned 250 total points
ID: 12152427
I think you can use this code in main form OnCreate event:


  ShowWindow(Application.Handle, SW_HIDE);
  SetWindowLong(Application.Handle, GWL_EXSTYLE,
    GetWindowLong(Application.Handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW );
  ShowWindow(Application.Handle, SW_SHOW);
0
 

Author Comment

by:ilmds123
ID: 12152739
vadim_ti,

Thanks for responding. I used your suggestion and it does indeed remove the app from the taskbar and leaves it in the ALT-TAB list as I need but I still have one problem. As I stated in my original question, while the app no longer appears in the TaskBar, it does insist on appearing as a small icon immediately above the TaskBar on the left hand side when minimized. Do you know of a way to keep the small icon from appearing when minimized?

Thanks,
ilmds123
0
 
LVL 2

Expert Comment

by:php4delphi
ID: 12155078
The problem is that you can switch using ALT-TAB only between visible windows. As soon as you hide all windows of your application is not possible to use ALT-TAB anymore. The solution can be to use OnMinimize event to move minimized form out of screen, for example at point -10000, -10000 and restore form position in OnRestore event.
0
 

Author Comment

by:ilmds123
ID: 12159211
Thanks to everyone for your help.  I accepted vadim_ti's answer for its succinctness and split with php4delphi for the assist as well as workshop_alex for providing an interesting alternative. To answer your question workshop_alex, my app does not currently use a trayicon. When given the time I'll look into system services in the future and will go with vadim_ti's for the present.

Thanks again everyone.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

19 Experts available now in Live!

Get 1:1 Help Now