SetParent

The SetParent function makes one window the child of another window.

Private Declare Function SetParent Lib “user32? _
    (ByVal hWndChild As Long, _
    ByVal hWndNewParent As Long) As Long

This function takes two arguments that are window handles. Use the FindWindow function to get the handles you need.

There’s probably a bunch of cool things you can do with SetParent, but I’ve only ever used it to show a userform from the VBE. I’ll show an example of that in my next post.

Posted in Uncategorized


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.