Re: newera file selection box
Posted in 1996
Carlos Costa e Silva wrote: > > Regarding article <4rbon0$15fi@news3.realtime.net>, earleb@bcs.com > (Earle Beach): > > Here goes an example on opening the file box on win95: > > ------ BEGIN CODE -------------------- > > function filebox( wheader, wfile ) > variable wheader char( 60 ) # Header of the window > variable wfile char( 60 ) # default file in file box > variable wtext char( 100 ) # output file name > variable wfilter char( 256 ) # filters > variable i smallint > > BEGIN_C > OPENFILENAME ofn; > END_C > > let wheader = wheader clipped, ascii 0 > > let wfilter = "Text files (*.txt)", ascii 0, "*.txt", ascii 0 > , "Documents (*.doc)", ascii 0, "*.doc", ascii 0 > , "CSV files (*.csv)", ascii 0, "*.csv", ascii 0 > , "All files (*.*)", ascii 0, "*.*", ascii 0 > , ascii 0 > > BEGIN_C > > memset( &ofn, 0, sizeof( OPENFILENAME ) ); > ofn.lStructSize = sizeof( OPENFILENAME ); > ofn.hwndOwner = __getHWndFromixWindow( frmwintop ); > ofn.lpstrFilter = wfilter; > ofn.lpstrFile = wtext; > ofn.nMaxFile = 101; > ofn.lpstrTitle = wheader; > ofn.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT > | OFN_PATHMUSTEXIST; > i = GetSaveFileName( &ofn ); > > END_C > > if i <> 0 then > let status = TRUE # status = TRUE -> OK > return wtexto > end if > > let status = FALSE # status = FALSE -> NOT OK > return wfile > end function > > # Fim Destino Ficheiro > Is it possible to use this source code to a file box in windows 3.11 too?? -------------------------------------------------- Sigurd Friisvold job: sfr@hk.tollpost.no private: sigurd.frisvold@login.eunet.no http://login.eunet.no/~sigfrisv/ --------------------------------------------------