תשתמש בקוד הזה
´============================================================================== ´ ´ ´ Name: ParentWindow ´ ´ ´============================================================================== Public Sub ParentWindow(hWndChild As Long, hWndParent As Long) If (hWndChild <> 0 And hWndParent <> 0) Then Dim dwStyle As Long ´Get the old style... dwStyle = GetWindowLong(hWndChild, GWL_STYLE) ´Clear the WS_POPUP style bit... dwStyle = dwStyle And Not WS_POPUP ´Set the WS_CHILD style bit... dwStyle = dwStyle Or WS_CHILD ´Set the new style... SetWindowLong hWndChild, GWL_STYLE, dwStyle ´Set the parent... SetParent hWndChild, hWndParent End If End Sub