
   /* Determine style to display bitmap */
if ( P3_ButtonGetCheck (hWndMainWindow_BtnAsis ) )
   wDisplayStyle = idMainWindow_BtnAsis;
else
   if ( P3_ButtonGetCheck (hWndMainWindow_BtnStretch ) )
      wDisplayStyle = idMainWindow_BtnStretch;
   else
      wDisplayStyle = idMainWindow_BtnTile;


   /* Get fully qualified file name of bitmap */
 GetWindowText (hWndMainWindow_EditBitmap, szFileName, 96 ) ;
 Call FileExpand (szFileName, szFileName) ;


   /* Split up into path and file name */
-splitPath (szFileName, NULL, szPathName, szFile, szExt);
/**********************
szFile =  Call GetFileName (szFileName) ;
if (szFile != szFileName)
   {
   nLen = szFile - szFileName;
   strncpy (szPathName, szFileName, nLen);
   if (szPathName [nLen] == ':')
      szPathName [nLen+1] = '\0';
   else
      szPathName [nLen] = '\0';
   }
else
   strcpy (szPathName, szFileName);
*********************/   

   /* If no file extension then test to see if it is a directory */
if (!strrchr (szFile, '.'))
   if (chdir (szFileName))
      strcat (szFileName, ".BMP");
   else
      {
      if (szPathName[0] != (getdisk() + 'A'))
         setdisk (toupper (szPathName[0]) - 'A');
       Call UpdateListBoxes (TRUE) ;
      return 0;
      }


   /* If directory or drive changed then set flag to update list boxes */
bDiffDir = strcmp (szPathName, szDirectory) != 0;


   /* If any wild cards in file name then don't open bitmap */
if (strchr (szFileName, '*') || strchr (szFileName, '?'))
   {
   if (bDiffDir)
      {
      if (szPathName[0] != (getdisk() + 'A'))
         setdisk (toupper (szPathName[0]) - 'A');
      chdir (szPathName);
       Call UpdateListBoxes (TRUE) ;
      }
   return 0;
   }


/********************
   // If file name ends with a backslash, then just change directories 
if (szP_athName[strlen (szPathName) - 1] == '\\')
   {
   if (szPathName[0] != (getdisk() + 'A'))
      setdisk (toupper (szPathName[0]) - 'A');
   chdir (szPathName);
    Call UpdateListBoxes (TRUE) ;
   return 0;
   }
**********************/   


   /* If file name ends with a ":", then just change drives */
if ((strlen (szPathName) == 2) && (szPathName[1] == ':'))
   {
   setdisk (toupper (szPathName[0]) - 'A');
    Call UpdateListBoxes (TRUE) ;
   return 0;
   }


   /* Delete handle to any existing bitmap */
if (hBMP)
    P3_BitmapDestroy (hBMP ) ;


   /* Update bitmap info fields */
 InvalidateRect (hWndMainWindow, &EBPtr->rectWidth, TRUE ) ;
 InvalidateRect (hWndMainWindow, &EBPtr->rectHeight, TRUE ) ;


   /* Load bitmap from the specified file */
 P3_SetHourGlass () ;
 hBMP = P3_BitmapLoadFromFile (szFileName, &EBPtr->nWidth, &EBPtr->nHeight, &nRC ) ;
 P3_RemoveHourGlass () ;


   /* If bitmap not loaded display error message */
if (nRC)
   {
   MessageBeep (0);
   MessageBox (hWndMainWindow, "File could not be loaded - not a valid bitmap file.",
               szFileName, MB_OK);
   }


   /* Set caption of main window to show name of bitmap */
strcpy (szCaption, szTitle);
if (hBMP)
   {
   strcat (szCaption, " - ");
   strcat (szCaption, strupr (szFile));
   }
 SetWindowText (hWndMainWindow, szCaption ) ;

   
   /* Force bitmap window to be redrawn */
 InvalidateRect (hWndBitmapWindow, NULL, TRUE ) ;


if (bDiffDir)
   {
   if (szPathName[0] != (getdisk() + 'A'))
      setdisk (szPathName[0] - 'A');
   chdir (szPathName);
    Call UpdateListBoxes (FALSE) ;
   }
