
'====================================================================
'' MONTHCAL_CLASS common control demo, modal dialog as main.
'====================================================================

#include "dialogs.bas"

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

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) = IDCANCEL Then
        EndDialog( hDlg, null )
      End If

    Case WM_CLOSE

      EndDialog( hDlg, null )

  End Select

  Return 0

End Function

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

Dim As LPDLGTEMPLATE lpdt

InitializeCommonControls

Dialog( 1, 0, 0, 120, 110, "Today", lpdt, _
        WS_OVERLAPPED Or WS_SYSMENU Or DS_CENTER )

Control( 100, -1, 0, 120, 100, "", 0, MONTHCAL_CLASS )

CreateModalDialog( 0, @DialogProc, 0, lpdt )

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