Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hide Application From Appearing Both On And Above XP Locked Taskbar

Posted on 2004-09-24
9
Medium Priority
?
226 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 600 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Independent Software Vendors: 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!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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