>>985 世話が焼けんなw ほとんどサンプルと同じものだが・・・

! see c:\Program Files\Intel\Compiler\11.0\066\fortran\Samples\Fortran\Win32\GetOpenFileName
MODULE m_open
USE comdlg32
USE user32 ! Interface for GetForegroundWindow
IMPLICIT NONE
CHARACTER(1), PARAMETER :: eot = ACHAR(0) ! end of text (end of C string)
CONTAINS
!-----------------------------------------------------------------
SUBROUTINE get_file(filename, filter)
IMPLICIT NONE
CHARACTER(*), INTENT(OUT) :: filename
CHARACTER(*), INTENT(IN ) :: filter
TYPE (T_OPENFILENAME) :: ofn
INTEGER :: istatus
ofn%lStructSize = sizeof(ofn)
ofn%hwndOwner = GetForegroundWindow()
ofn%hInstance = NULL ! hInstance
ofn%lpstrFilter = loc(filter)
ofn%lpstrCustomFilter = NULL
ofn%nMaxCustFilter = 0
ofn%nFilterIndex = 1 ! Specifies initial filter value
ofn%lpstrFile = loc(filename)
ofn%nMaxFile = LEN(filename) - 1
ofn%nMaxFileTitle = 0
ofn%lpstrInitialDir = NULL ! Use Windows default directory
ofn%lpstrTitle = loc('' // eot)
ofn%Flags = OFN_PATHMUSTEXIST
ofn%lpstrDefExt = loc('txt' // eot)
ofn%lpfnHook = NULL
ofn%lpTemplateName = NULL