Date: Mon, 29 Dec 1997 10:12:39 +0200 (IST) From: Eli Zaretskii To: Rich Dawe cc: djgpp AT delorie DOT com Subject: Re: Setting DOS box title under Win95 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sat, 27 Dec 1997, Rich Dawe wrote: > function to get the *actual* short filename for a file given the long > filename What's wrong with `_truename' in the library? Doesn't it do its job? For example, something like this should work (untested): char *short_alias(const char *long_name) { char *lfn = getenv("LFN"); char *retval; if (!lfn || tolower(*lfn) != 'n') putenv ("LFN=n"); retval = _truename (long_name, NULL); if (!lfn) putenv ("LFN"); /* delete from environ */ else putenv (lfn - 4); /* restore old setting */ return retval; } > /* Allocate some DOS memory */ > alloc_seg = __dpmi_allocate_dos_memory(APP_TITLE_BUFFER_PARA, > &alloc_desc); > if (alloc_seg == -1) return(-1); You might have saved some work here by using the DJGPP transfer buffer. It is already allocated for you and is at least 2KB-long, (usually 16KB) which should be more than enough for getting the title.