Software Archive
Read-only legacy content
17060 Discussions

GetOpenFileName from samples(advanced-win32)

Intel_C_Intel
Employee
1,427 Views
I am using that project for my purpose; I want to go little bit beyond-that is I want to open and edit a file from the list using say wordpad, word etc. What should I add after-

status = GetOpenFileName(ofn)
if (status .eq. 0) then
type *,'No file name specified'
else
! Get length of file_spec by looking for trailing NUL
ilen = INDEX(file_spec,CHAR(0))
type *,'Filespec is ',file_spec(1:ilen-1)
! Example of how to see if user said "Read Only"
!
if (IAND(ofn%flags,OFN_READONLY) /= 0) &
type *,'Readonly was requested'
end if
0 Kudos
1 Reply
Steven_L_Intel1
Employee
1,427 Views
See my Win32 Corner column in Visual Fortran Newsletter Issue 8, which discusses the use of ShellExecute. In your case, use the "edit" action, and it will automatically open the file in the application registered for that file type.

Steve
0 Kudos
Reply