CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How create child window?

  1. #1
    Join Date
    Jun 2014
    Posts
    21

    How create child window?

    I create main window by CreateWindowEx() but I want child window like button. Child window should automatically move when parent window moves.
    How create it?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,985

    Re: How create child window?

    Handle the WM_CREATE message to create a child control. You could use the same CreateWindowEx to do it but passing the correct window class of the control ("button" for button control)
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,607

    Re: How create child window?

    Quote Originally Posted by Borneq View Post
    Child window should automatically move when parent window moves.
    Any window having WS_CHILD style is moved along with its parent.

    PS. To prevent flooding the forum with your other How-to questions I would recommend you to start with reading some good book covering Windows GUI programming basics. Like Petzold's Programming Windows.
    Best regards,
    Igor

  4. #4
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: How create child window?

    You can Create child window by using WS_CHILD as mentioned by igor and don't forget to provide the handle of it's parent window while creating the child.


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




On-Demand Webinars (sponsored)