From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-02-2011 12:46 AM
Hello all,
I am using User32.dll to make a parent-child relationship between two VIs. I use SetParent function, and pass the handle of parent VI and child VI to this function. Now, after this relationship has been established, I want to remove the child window from the parent and use it as a independent VI using WIN API. Can anyone help me on this?
Thanks in advance!
Fragger Fox!
Solved! Go to Solution.
03-02-2011 12:51 AM
Hi Fragger Fox,
i think it should be possible if you assign a new parent to the child. Maybe it works if you assign the desktop as new parent.
Hope it helps.
Mike
03-02-2011 01:24 AM - edited 03-02-2011 01:25 AM
@MikeS81 wrote:
Hi Fragger Fox,
i think it should be possible if you assign a new parent to the child. Maybe it works if you assign the desktop as new parent.
Hope it helps.
Mike
I am thinking if that would really work. Since the child already has a parent, just giving it a handle of other parent would make it a child of other parent, in this case, the desktop? Would it automatically remove itself from its parent?
Also, how can we get the desktop handle?
Fragger Fox
03-02-2011 01:31 AM
Hi Fragger Fox,
from the description of the "SetParent" function, i think it will change the parent. You can get the desktop handle with the "GetDesktopWindow" function.
Mike
03-02-2011 03:52 AM
You should be able to set a NULL handle to undo the parent-child relationship and make the child window again a normal top level window. Setting the desktop as parent is probably not the same as being a top level window.