Solved

Hide Application From Appearing Both On And Above XP Locked Taskbar

Posted on 2004-09-24
9
218 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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
 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Delphi: how to send PJL commands to printer 3 99
Find and Replace Stream with 0s 8 62
Not able to call Delphi XE10 dll function from Delphi 6.0 4 26
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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