WRSelectImageInfo * WRAPI WRSelectImage( HWND parent, WRInfo *rinfo, FARPROC hcb ) { DLGPROC proc; HINSTANCE inst; INT_PTR modified; WRSelectImageInfo *info; if( rinfo == NULL ) { return( NULL ); } info = (WRSelectImageInfo *)MemAlloc( sizeof( WRSelectImageInfo ) ); if( info == NULL ) { return( NULL ); } memset( info, 0, sizeof( WRSelectImageInfo ) ); info->hcb = hcb; info->info = rinfo; inst = WRGetInstance(); proc = (DLGPROC)MakeProcInstance( (FARPROC)WRSelectImageProc, inst ); modified = JDialogBoxParam( inst, "WRSelectImage", parent, proc, (LPARAM)info ); FreeProcInstance( (FARPROC)proc ); if( modified == -1 || modified == IDCANCEL ) { MemFree( info ); info = NULL; } return( info ); }
WRFileType WRAPI WRSelectFileType( HWND parent, const char *name, bool is32bit, bool use_wres, FARPROC hcb ) { DLGPROC proc; HINSTANCE inst; INT_PTR modified; WRSFT sft; WRFileType guess; guess = WRGuessFileType( name ); if( guess != WR_DONT_KNOW ) { return( guess ); } guess = educatedGuess( name, is32bit, use_wres ); if( guess != WR_DONT_KNOW ) { return( guess ); } sft.hcb = hcb; sft.file_name = name; sft.file_type = WR_DONT_KNOW; sft.is32bit = is32bit; sft.use_wres = use_wres; inst = WRGetInstance(); proc = (DLGPROC)MakeProcInstance( (FARPROC)WRSelectFileTypeProc, inst ); modified = JDialogBoxParam( inst, "WRSelectFileType", parent, proc, (LPARAM)&sft ); FreeProcInstance( (FARPROC)proc ); if( modified == -1 ) { return( WR_DONT_KNOW ); } return( sft.file_type ); }