PDA

View Full Version : how to get rid of residual program in task bar ???



atozix
13-10-2003, 02:39 AM
Hi all ,,, :)

Obviously new at this...

After running some programs from Delphi 5, There is a residual box from the program still in the task bar.... If i run the program say 5 times, there will be 5 residual boxes etc...
This can mount up considerably, I can get rid of them by clicking on them, but I want to know how to prevent them from staying there in the first place.....

All is normal with windows programs...BUT when using DelphiX, this problem occurs... as soon as I use fullscreen mode....

I am sure it is a simple thing.. Can anyone help me out ....

Cheeeeeeerrrrrrsssssss atozix

Traveler
13-10-2003, 08:39 AM
I've had that problem as well. I've resolved it by removing the taskbar button on startup.

C/P this snippet in the oncreate event and you're done

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

Note that this isn't a perfect solution as an ALT_TAB might confuse users who temporarily want to switch back to windows and, later on, find themselves looking for the button to return to the game.

atozix
13-10-2003, 10:50 AM
Hi ,,

Thx for the reply Traveller,.. I have found another solution that works really well....

On escape key , instead of just close;
I now use release; Terminate.Application;

Does the trick.. :)
cheeeeeeerrrrrrsssss atozix

Alimonster
13-10-2003, 03:11 PM
The button is a Windows 9x bug for apps closing while in a full-screen window. You can remove it by ensuring that your program doesn't finish in full-screen mode. I forget the exact method involved, but it's something like setting "WindowState := wsNormal" in the main form's OnDestroy event. You may need to give it a border too (or try wsMinimized for the window style). However, that's the basic solution for ya.

Keep in mind that 9x is getting _long_ in the tooth these days - don't care too much about such a small, 9x-specific "bug" ;).

Also, I found clicking the empty taskbar buttons quite relaxing. Maybe your next game can generate empty taskbar buttons and have the user click them before the taskbar gets filled up (or shoot them if you're into violence). Yes... I command you to make that game.

atozix
14-10-2003, 07:24 PM
Hi Alimonster,,,

hahahahahhahahha, falls of chair...

Yes it is something to while away idle moments with, a good time wasting activity for us game players.... :)

hmmmm, well thx 4 the comments and I found that for some programs, when my above mentioned so called solution did not work, then placing the release instruction in the form close routine did work... Anyway, it can be got rid of...

As far as a relaxing dispersal of blank boxes goes... It may actually be therapeutic, but becomes a little tedious when one is frantically compiling programs again and again due to the inadequacy of ones programming skills.... hehehehe

Cheeeeeeeeerrrrrrrrrsssssssssssss atozix :)