
'====================================================================
'' Bitmap from resource demo, modal dialog as main.
''
'' This assumes that the executable file contains an BITMAP
'' resource with the identifier 1000. This would typically be
'' done by placing a resource definition something like this:
''
'' 1000 BITMAP "fblogo.bmp"
''
'' in a .RC file and including the file on the FBC command line.
'====================================================================

#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 lpdt As LPDLGTEMPLATE

Dialog( 1, 0, 0, 120, 90,"Bitmap From Resource Demo", lpdt, _
        WS_OVERLAPPEDWINDOW Or DS_CENTER )

Control( 100, 0, 0, 0, 0, "", 1000, "STATIC", SS_BITMAP )

CreateModalDialog( 0, @DialogProc, 0, lpdt )

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