none
SetParent to the window of another process fails in Windows 10, but works in Window 7 RRS feed

  • Question


  • Hi,

    I have an application which is running perfectly on Windows 7 for years, is not working in Window 10. The application hosts another application's main window as a child of an ATL window in the main application.

    SetParent() always returns the error "The parameter is incorrect" in Windows 10.

    Kindly suggest a way to resolve this, it is not possible to change the SetParent() command at this moment because of huge source changes required due of the current architecture.



    Regards,

    Anoop

    Saturday, August 19, 2017 10:04 AM

All replies

  • Hi Anoop,

    Thank you for posting here.

    Did you use the GetLastError function to get more error message?

    According to the description, it seems to be bug on windows 10, did you use the last windows 10 version?  you can post the issue on connect website, which will solve bug issue.

    As far as I know that the  if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent .

    If hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling SetParent.

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, August 21, 2017 6:53 AM
    Moderator
  • Thanks Hart for the suggestion.

    I have set the window of application_1 as WS_CHILD and tried to set the parent (window of application_2) which is not NULL and that too failed. The GetLastError() returns "The parameter is incorrect" only. No additional info.

    B/w, I'm using the latest Windows 10, the issue was not existing in earlier versions of windows 10.

    Regards,

    Anoop


    • Edited by Anoop C Monday, August 21, 2017 4:38 PM
    Monday, August 21, 2017 4:31 PM
  • Hi Anoop,

    Thank you for posting here.

    According to your description, the issue seem be a bug on latest windows 10. You can post the issue on connect website, which will solve the issue.

    On next version will update.

    Best Regards,

    Hart

    Edit:

    Could you please provide a reproducing demo for me to test the issue on one drive?


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, August 22, 2017 8:48 AM
    Moderator