Thread: curiousity about owned window

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    51

    curiousity about owned window

    I am wondering if it is improper to create an owned window using WS_POPUP. When I used this window style, the window would not show itself, however, when I changed it to WS_OVERLAPPED it worked just fine. Is WS_POPUP the incorrect style to use for an owned window, or should I be looking in my code for some other underlying problem?

    Thanks in advance

  2. #2
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    This should cover everything you need to know: Window Types

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Did you even try calling ShowWindow() on your WS_POPUP window?

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    By 'owned' I assume you mean has the WS_CHILD style.

    WS_POPUP and WS_CHILD are mutually exclusive.

    http://msdn2.microsoft.com/en-us/library/ms632600.aspx

    Quote Originally Posted by Yarin View Post
    Did you even try calling ShowWindow() on your WS_POPUP window?
    If the overlapped window appeared, you would assume that the window has the WS_VISIBLE style or ShowWindow() was called.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    51
    Quote Originally Posted by novacain View Post
    By 'owned' I assume you mean has the WS_CHILD style.

    WS_POPUP and WS_CHILD are mutually exclusive.

    http://msdn2.microsoft.com/en-us/library/ms632600.aspx



    If the overlapped window appeared, you would assume that the window has the WS_VISIBLE style or ShowWindow() was called.

    Sorry for the slow reply, I don't have internet access every day.

    Thanks, msdn was very helpful. I believe either I have some other flaw in my code or there is a bug in the compiler because all I do is swap out WS_POPUP and it works fine.

    I do not mean child when I write "owned." I am making a dialog box. I would also like to use this technique in other portions of my program to provide additional information to the user, so I thought I'd ask you all if I did something improper. I think I tried ShowWindow(), but when I get back to coding, I'll look.

  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Does CreateWindow() return a valid HWND or NULL?

    If NULL what does GetLastError() return?

    Please post some code, the call to create the dlg and the dlg's WM_INITDIALOG handler.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM