Jump to content
  • Advertisement
Sign in to follow this  
Gullanian

C++ Win32 App Create multiple windows

This topic is 4324 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, At the moment I use one HWND for my program, which seems to work fine. However, I'm having a lot of trouble creating another window in the same program, for example someone clicks a button, the current window remains the same but a new window opens. The furthest I have gotten is having the new window open sucessfully, but it's white, and it can't be moved or closed, can anyone point me to an article or briefly explain what I have to do to create a new window? Thanks, Tom

Share this post


Link to post
Share on other sites
Advertisement
There could be any number of problems that is causing this to happen. The most obvious from the sounds of it is an incorrect message pump, messages for the new window aren't getting to it. The message pump is the loop that contains the TranslateMessage/DispatchMessage function calls. Your call to GetMessage (or PeekMessage) is probably using the handle of the first window that you create as its second parameter. Use null as the window handle to GetMessage and it will process the messages for all your windows.

Skizz

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!