Mail Archives: djgpp/1998/01/01/20:15:55
Rich Dawe wrote:
>
> : > /* Allocate some DOS memory */
> : > alloc_seg = __dpmi_allocate_dos_memory(APP_TITLE_BUFFER_PARA,
> : > &alloc_desc);
> : > if (alloc_seg == -1) return(-1);
> :
> Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
> : 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.
Rich Dawe wrote:
> I tried this but it didn't seem to work. This did work, so I went
> with it. I might try using the transfer buffer again. Thank you.
here's the code i posted for the original request. using the transfer
buffer works fine:
/*
* apptitle.c
* routine to demonstrate how to change the title bar of the ms-dos
window
* in windows 95
* info taken from Ralph Brown's Interrupt List
* INT 2F 168E - Windows95 - TITLE - SET APPLICATION TITLE
*
* by A. Sinan Unur
* 12/10/97
* note that this code comes with absolutely no warranties of any kind
* try it at your own risk.
*/
#include <dos.h>
#include <dpmi.h>
#include <go32.h>
#include <string.h>
#include <sys/movedata.h>
#define RM_SEG(x) ( (unsigned short) ((x) >> 4) )
#define RM_OFF(x) ( (unsigned short) ((x) & 0xF) )
int set_app_title(const char *p, int len)
{
__dpmi_regs r;
memset(&r, 0, sizeof(r));
movedata(_my_ds(), (unsigned) p, _dos_ds, __tb, len);
r.x.ax = 0x168e;
r.x.dx = 0x0000;
r.x.di = RM_OFF(__tb);
r.x.es = RM_SEG(__tb);
return __dpmi_int(0x2f, &r);
}
int main(int argc, char* argv[])
{
int i;
delay(5);
for(i=0; argv[i] != NULL; i++)
{
set_app_title(argv[i], strlen(argv[i])+1);
delay(2000);
}
return 0;
}
--
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA
mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/
- Raw text -