home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
- Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal Param As Integer) As Integer
- Declare Function SetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal Param As Integer, ByVal word As Integer) As Integer
-
- Sub SetChild (ByVal ChildhWnd As Integer, ByVal ParenthWnd As Integer, Flag As Integer)
- Dim rc As Integer
- Static Cnt As Integer
- Static hWndList() As Integer
- Static ParentList() As Integer
- If Flag Then
- rc = GetWindowWord(ChildhWnd, -8)
- If rc Then
- If Cnt Then
- ReDim Preserve hWndList(Cnt)
- ReDim Preserve ParentList(Cnt)
- Else
- ReDim hWndList(Cnt)
- ReDim ParentList(Cnt)
- End If
- hWndList(Cnt) = ChildhWnd
- ParentList(Cnt) = rc
- rc = SetWindowWord(ChildhWnd, -8, ParenthWnd)
- Cnt = Cnt + 1
- End If
- Else
- For rc = 0 To Cnt - 1
- If hWndList(rc) = ChildhWnd Then
- hWndList(rc) = 0
- rc = SetWindowWord(ChildhWnd, -8, ParentList(rc))
- Exit For
- End If
- Next rc
- End If
- End Sub
-
-