Prevent Multiple Windows from opening

Forum thread started by sl9c5 on Fri, 2004-11-19 21:20

What is the best way to prevent multiple windows from opening?

I'm opening a window within a MessageReceived() switch statement.

I've tried checking pointer and doing some other things.

I'm wondering if I'm missing something simple.

sl9c5

Comments

Prevent Multiple Windows from opening

Dunno. Use a semaphore, or global variable to keep track of the window count. If the count is above the max number of windows, through away the message. Isn't it that simple? :?:

Prevent Multiple Windows from opening

Thanks,
I'll try some more things, I thought that there might be a standard way to keep track of the windows.

sl9c5

There is one

sl9c5 wrote:
Thanks,
I'll try some more things, I thought that there might be a standard way to keep track of the windows.

sl9c5

Actually there is one:
BApplication::CountWindows() will return the number of windows which the app has created. See the BApplication section in the bebook for more info.

Prevent Multiple Windows from opening

Thanks for your help

sl9c5