Page 1 of 1

Posted: Tue Jul 30, 2002 5:34 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

Hi all,

Here's my problem:
I've set up a WindowCallback procedure and now the prog is only waiting for it
to be called.
So the main prog is just doing nothing.

My Question now is: What is the best way of doing that, to take of not so much system recources.

I've done something like this:

Code: Select all

Repeat
  Sleep_(1)
ForEver 
But is there some better way?

Thanks,

Timo

--

A debugged program is one for which you have not yet found the conditions that make it fail.

Posted: Tue Jul 30, 2002 7:59 pm
by BackupUser
Restored from previous forum. Originally posted by Kendrel.

Have you tried WaitWindowEvent() ?! I had kinda same problem the first day i used PB... have a closer look in the docs, it might help you!

regards,

Kendrel

Posted: Tue Jul 30, 2002 8:23 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

But I don't wait for eny event!
I just want the prog to do nothing, without using much resources.

Timo

Posted: Tue Jul 30, 2002 11:09 pm
by BackupUser
Restored from previous forum. Originally posted by scurrier.

try a delay(1) or sleep_(1) this should free your system

Posted: Wed Jul 31, 2002 3:11 am
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

I think Franco posted an example of an API based app, with GetMessage_() and so on, I think you may use that. But WaitWindowEvent() works Ok, too, why use Forever? You won't wait for #PB_EventCloseWindow either?

Bye,

El_Choni

Posted: Wed Jul 31, 2002 9:33 am
by BackupUser
Restored from previous forum. Originally posted by freak.

Thanks El_Choni,
GetMessage_() works fine.

The prog just waits for a Message send by PostMessage_(), and then processes it.
So there will be no purebasic Events. (That's why i used ForEver)

Anyway, problem solved now, thanks all,

Timo

--

A debugged program is one for which you have not yet found the conditions that make it fail.