Solved

Hide Application From Appearing Both On And Above XP Locked Taskbar

Posted on 2004-09-24
9
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

724 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