Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8164247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:16:29+00:00 2026-06-06T19:16:29+00:00

I have a parent window and a few child windows attached to this. With

  • 0

I have a parent window and a few child windows attached to this. With SpyXX I can see the children all have a certain style class, lets say ChildWindowClass.

When I create the window with the name of this particular class, CreateWindowEx returns a NULL handle. If I use my own class and just set the parent, the window is a child window, but – of course – has a different class as all the other children.

If I get me the style and then set it, the style is found, but not set for my child window. It still shows the style used with CreateWindowEx

HWND firstChild = FindWindowEx(MyClass::_parent, NULL, szFsxChildWindowClass, NULL);
LONG childStyle = GetWindowLong(firstChild, GWL_STYLE);
...
SetWindowLong(MyClass::_child,GWL_STYLE, childStyle);

The ChildWindowClass is not registered by me, so I can not crosscheck how it is registered. So how can I set this style for my child window?

— Edit call as requested —

 child = CreateWindowEx( WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR,
        szWindowClass, // this is where I want to place the name of the child class
        _T("Test"),
        WS_CHILDWINDOW | WS_VISIBLE,
        x,y, // 0,0
        w, h, // 500,100
        MyClass::_parent, // parent
        NULL,
        MyClass::_hInstance, // must this be 0??
        NULL
        );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:16:31+00:00Added an answer on June 6, 2026 at 7:16 pm

    Check GetLastError. If it’s nonzero, you’re most probably misusing API. If it is 0, it means that window procedure explicitly failed the creation by returning FALSE from WM_NCCREATE or WM_CREATE.

    When handling these messages the window procedure has access to all parameters that you pass to the function (styles, title, coordinates, parent window and menu), and that specific window class may require additional data to be passed via lpCreateParams, or even in title or coordinates, failing the creation otherwise.

    Set breakpoint or hook WM_CREATE for windows of that class and examine how those existing child windows were created, what were the parameters. (Assuming you don’t just have documentation on it!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several child windows, all with the same parent. I want to cascade/tile
I have this iFrame in my parent window... <iFrame src=http://theirdomain.com id=Post_iFrame></iFrame> Then I have
Want to run javascript function from parent window in child window Example I have
I have parent/child relationship set up via Node Reference. A Child record can have
If you have Parent has_many :children Child Is there any reason a foreign key
I have a parent window create a child window. When the child window closes,
I have a MDI parent window that can contain mulitple instances of a particular
I have problem to release div in parent window. I need to do this:
I am reading from MSDN this: A child window has only one parent window,
I have created a window whose handle is handle_parent. Then I created a child

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.