minimizing
Blitz3D Forums/Blitz3D Beginners Area/minimizing
| ||
I have a screen saver I am working on, and it seems to minimize every once in a while to the desktop...THere are no stops, and When run in debugging mode it always stops on the next command in a for i = 1 to 10000 loop...I am wondering if this is a bug, or what it could be that gets past the debug....It takes about 20 minutes to happen... |
| ||
Maybe it is some other program that sets the main focus to the desktop ? |
| ||
hi mindstorms post some code and we can see, this may be because you are re-assigning 'i' within the loop. eg (this is very bad): for i=1 to 10 i=4 next |
| ||
Sorry for the long wait, been away and busy... I think it may be itunes. It seems to take focus from other programs now and again...It just never seems to take from full screen applications...Is there a way to force itunes to stop? |
| ||
If its a screensaver, why not keep it in fullscreen? |
| ||
It could lose focus nevertheless. |
| ||
Task manager can close applications, so there must be a way to do it. I think TerminateProcess() in kernel32 might do it. Here is some thread about it: http://forum.skill-club.com/archive/index.php/t-17803.html Here is a program that kills/restarts iTunes in Delphi: http://www.delphipages.com/threads/thread.cfm?ID=147628&G=147624 |
| ||
That may just do it. Careful not to get peoples back up though, i certainly wouldnt like it if a screensaver messed with my taskbar, may cause memory holes etc if processes get terminated externally. |
| ||
WOuld it be better to simply automatically maximize the program when it looses focus? Is this easier (and safer)? |
| ||
thats probably a better idea, if theres a way of reading a windowstate from win32(or one of them) and if minid then maxit. Or mabe you could call the maximize function every so many seconds, so it only looses focus for a second or two (dont know if this will cause jitter though). alternatively, what about the 'always on top' flag thatsome progs seem to set. That might help too. |
| ||
Thanks d-Grafix...Found the flag in a win32 dll...works fine now :) |