
'====================================================================
'' Icon from resource demo, modal dialog as main.
''
'' This assumes that the executable file contains an ICON resource
'' with the identifier 1000. This would typically be done by
'' placing a resource definition something like this:
''
'' 1000 ICON "fblogo.ico"
''
'' 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_CLOSE

      EndDialog( hDlg, null )

  End Select

  Return 0

End Function

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

Dim As LPDLGTEMPLATE lpdt

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

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

CreateModalDialog( 0, @DialogProc, 0, lpdt )

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