
'====================================================================
'' Test app for dialog in DLL demo, modal dialog as main.
'====================================================================

#include "dialogs.bas"
#inclib  "dlldialog"

Declare Sub ShowDialog( Byval As HWND )

'====================================================================

Function DialogProc( Byval hDlg As  HWND, _
                     Byval uMsg As UINT, _
                     Byval wParam As WPARAM, _
                     Byval lParam As LPARAM ) As Integer
  Select Case uMsg

    Case WM_COMMAND

      If loword(wParam) = 100 Then
        ShowDialog( hDlg )
      End If

    Case WM_CLOSE

      EndDialog( hDlg, null )

  End Select

  Return 0

End Function

'====================================================================

Dim As LPDLGTEMPLATE lpdt

Dialog( 1, 0, 0, 120, 90, "Dialog from DLL Demo", lpdt, _
        WS_OVERLAPPEDWINDOW Or DS_CENTER )

DefPushButton( 100, -1, 65, 50, 12, "Show Dialog" )

CreateModalDialog( 0, @DialogProc, 0, lpdt )

'====================================================================
 