Keeping focus of a window

BlitzPlus Forums/BlitzPlus Programming/Keeping focus of a window

Pineapple(Posted 2004) [#1]
Hiya,
Can a blitz program still do it's stuff, even if it's running behind another app... I dont want to hide it next to the clock or anything, as long as it's on the taskbar... I'm happy!!! But, I've noticed that it sorta stops when you put another window in front of it, then only resumes when you give focus back to the window!!!

Is there anyway of keeping it going???

Dabz

:)


pantsonhead.com(Posted 2004) [#2]
Have a look at AutoSuspend

http://www.blitzbasic.com/bpdocs/command.php?name=AutoSuspend&ref=2d_cat


Mr Brine(Posted 2004) [#3]
try adding the following line of code to the top of your source:

AutoSuspend False

Mr Brine


Pineapple(Posted 2004) [#4]
That's the first thing I've tried!!! But it still hangs when a new window has focus!!! :(

Dabz

:)


Pineapple(Posted 2004) [#5]
Can anyone help me with this???

Now, I know when a user brings another window to the foreground, because the event return's $2002

But, if I do this:-

win = CreateWindow("Blah",0,0,300,300,Desktop(),5)

;hwnd = QueryObject(win,1)


Repeat

WaitEvent()
id=EventID()
Select(id)
Case $803
Exit
Case $2002
Notify "Na"
End Select

Forever

The blitz window goes behind the new window, and the notify command only gets called when I bring the blitz window back to the top!!! But I want it to get called straight away, as soon as they switch windows!!!

Anyone get me???

Dabz

:(

P.S. I've tried use AUTOSUSPEND, but to me, that command does nothing???


Mr Brine(Posted 2004) [#6]
try replacing the $2002 with $2001


Pineapple(Posted 2004) [#7]
lol, cheers Mr Brine!!!

Jeez, I've spent hours mucking on with that!!! :(

Anyway, thanks very much for your help.. much appreciated!!! :D

Dabz

:)