Prevent Multiple Windows from opening

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

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? :?:

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

sl9c5

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.

Thanks for your help

sl9c5