minimizing

Blitz3D Forums/Blitz3D Beginners Area/minimizing

mindstorms(Posted 2006) [#1]
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...


b32(Posted 2006) [#2]
Maybe it is some other program that sets the main focus to the desktop ?


D4NM4N(Posted 2006) [#3]
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


mindstorms(Posted 2006) [#4]
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?


D4NM4N(Posted 2006) [#5]
If its a screensaver, why not keep it in fullscreen?


jfk EO-11110(Posted 2006) [#6]
It could lose focus nevertheless.


b32(Posted 2006) [#7]
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


D4NM4N(Posted 2006) [#8]
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.


mindstorms(Posted 2006) [#9]
WOuld it be better to simply automatically maximize the program when it looses focus? Is this easier (and safer)?


D4NM4N(Posted 2006) [#10]
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.


mindstorms(Posted 2006) [#11]
Thanks d-Grafix...Found the flag in a win32 dll...works fine now :)