VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "csSubDll4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Function OpenWindow(hWnd As Long, iIndex As Integer) As Long

    If iIndex = 4 Then

        SetParent frmSubDll4.hWnd, hWnd
        ShowWindow frmSubDll4.hWnd, 1
        'frmSubDll4.Show vbModal
        OpenWindow = frmSubDll4.hWnd
        
        
        MessageLoop frmSubDll4.hWnd
        
    End If

End Function


Private Sub MessageLoop(hDialog As Long)
    On Error Resume Next
  
    ' Keep looking for messages while the Find/Replace dialog is still open
    Do While GetMessage(TheMessage, 0&, 0&, 0&) And hDialog > 0
        
        ' If the current message is a message from the Find/Replace Dialog's owner, process it here
        If IsDialogMessage(hDialog, TheMessage) = 0 Then
        
            'Debug.Print "Calling Form Message - hDialog = " & CStr(hDialog) & ", TheMessage = " & CStr(TheMessage.Message)
             TranslateMessage TheMessage
             DispatchMessage TheMessage
           
        ' If the current message is a message from the Find/Replace Dialog it self, process it here
        Else
         'Debug.Print "Dialog Message - hDialog = " & CStr(hDialog) & ", TheMessage = " & CStr(TheMessage.Message)
         'frmSubDll4.lblStatus.Caption = "Frame1 - " & CStr(frmSubDll4.Frame1.hWnd) & " : Msg - hDialog = " & CStr(hDialog) & ", TheMessage = " & CStr(TheMessage.message) & ", hwnd = " & CStr(TheMessage.hWnd)
         If TheMessage.hWnd = frmSubDll4.Frame1.hWnd Or _
            TheMessage.hWnd = frmSubDll4.Option1.hWnd Then
            
            MsgBox "msg : " + CStr(TheMessage.hWnd) + ", frame : " + CStr(frmSubDll4.Frame1.hWnd) + ", option1 : " + CStr(frmSubDll4.Option1.hWnd)
        End If
       
        End If
    Loop
  
End Sub
