home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / mac / SiteBldr / AMOVIE / SDK / _SETUP / COMMON.Z / file.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-26  |  2.0 KB  |  59 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992 - 1996  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. // file.c - handles the file..open dialog box
  13.  
  14. #include "stdwin.h"
  15. #include "file.h"
  16.  
  17. static OPENFILENAME ofn;
  18.  
  19. BOOL InitFileOpenDialog( HWND hwnd ){
  20.  
  21.     ofn.lStructSize         = sizeof( OPENFILENAME );
  22.     ofn.hwndOwner           = hwnd;
  23.     ofn.hInstance           = NULL;
  24.     ofn.lpstrFilter         = "Media files\0*.MPG;*.AVI;*.MOV;*.WAV\0"
  25.                               "MPEG files\0*.MPG\0"
  26.                               "AVI files\0*.AVI\0"
  27.                               "Quick Time files\0*.MOV\0"
  28.                               "Wave audio files\0*.WAV\0"
  29.                               "Filter graph files\0*.GRF\0"
  30.                               "All Files\0*.*\0\0";
  31.     ofn.lpstrCustomFilter   = NULL;
  32.     ofn.nMaxCustFilter      = 0;
  33.     ofn.nFilterIndex        = 0;
  34.     ofn.lpstrFile           = NULL;
  35.     ofn.nMaxFile            = _MAX_PATH;
  36.     ofn.lpstrFileTitle      = NULL;
  37.     ofn.nMaxFileTitle       = _MAX_FNAME + _MAX_EXT;
  38.     ofn.lpstrInitialDir     = NULL;
  39.     ofn.lpstrTitle          = NULL;
  40.     ofn.Flags               = OFN_FILEMUSTEXIST;
  41.     ofn.nFileOffset         = 0;
  42.     ofn.nFileExtension      = 0;
  43.     ofn.lpstrDefExt         = "mpg";
  44.     ofn.lCustData           = 0;
  45.     ofn.lpfnHook            = NULL;
  46.     ofn.lpTemplateName      = NULL;
  47.  
  48.     return TRUE;
  49. }
  50.  
  51. BOOL DoFileOpenDialog( HWND hwnd, LPSTR lpstrFileName, LPSTR lpstrTitleName ){
  52.     // Called to display the open file dialog
  53.     ofn.hwndOwner = hwnd;
  54.     ofn.lpstrFile = lpstrFileName;
  55.     ofn.lpstrFileTitle = lpstrTitleName;
  56.  
  57.     return GetOpenFileName( &ofn );
  58. }
  59.