Windows SDK: What is an owned window?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Windows SDK: What is an owned window?

  1. #1
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    Windows SDK: What is an owned window?

    Q: What is an owned window?

    A: An owned window is a top-level window that has an owner.
    It has the following properties:
    • being a top-level window, it can be displayed anywhere in the screen;
    • it stays always in the front of its owner window;
    • it is hidded when its owner is hidden or minimized;
    • it is destroyed when its owner is being destroyed;

    Notes
    • An owned window is created by passing the owner window handle as hWndParent parameter in CreateWindow(Ex) function call.
    • WS_CHILD style must not be set, otherwise results a child and not an owned top-level window.


    Example
    Code:
    // create an owned top-level window
    HWND hWnd = CreateWindow(szWindowClass, szTitle, 
                  WS_OVERLAPPED, // WS_CHILD style is not set
                  CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 
                  hWndParent,    // handle to the OWNER window
                  NULL, hInstance, NULL);
    See also
    Last edited by ovidiucucu; January 25th, 2010 at 07:33 AM.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center