[API]
LocalAlloc
RtlMoveMemory
LocalFree

[INCLUDE]
LoadResEx_DialogProc
DialogBoxIndirectParam

[CODE]
Public Function LoadResEx_Dialog(ByVal hWndOwner As Long, ByVal ResDialogOrID As Variant, Optional DefaultButtonID As Long = 0&, Optional ByVal CanEscapeControlID As Long = LoadResEx_Dialog_Disabled, Optional ByVal CallBackProc As Long) As Long
  Dim xLong1 As Long
  Dim xType1 As LoadResEx_Dialog_DialogInfo
    
  xType1.xCallBackProc = CallBackProc
  xType1.xEscBehaviour = CanEscapeControlID
  xType1.xButtonCtlID = DefaultButtonID
  xLong1 = LocalAlloc(0&, LoadResEx_Dialog_DialogInfoSize)
  If Not xLong1 = 0& Then
    Call RtlMoveMemory(ByVal xLong1, xType1, LoadResEx_Dialog_DialogInfoSize)
    LoadResEx_Dialog = DialogBoxIndirectParam(ResDialogOrID, hWndOwner, AddressOf LoadResEx_Dialog_InternalProc, xLong1)            ', ResDialogID)
    Call LocalFree(xLong1)
    End If
  End Function