delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/05:31:11

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Setting program name?
Date: Wed, 10 Dec 1997 18:28:19 -0500
Organization: Cornell University (http://www.cornell.edu/)
Lines: 84
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <348F2593.9B7E0659@cornell.edu>
References: <66korf$mul AT news DOT euro DOT net> <348DF1C2 DOT C3E83797 AT cornell DOT edu> <66mas3$k2l AT news DOT euro DOT net>
NNTP-Posting-Host: cu-dialup-0093.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Steven Don wrote:
> 
> In article <348DF1C2 DOT C3E83797 AT cornell DOT edu>, "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu> wrote:
> >Steven Don wrote:
> >> box (and resets it when quitting). Does anybody know how this is
> >> performed? Somebody knows, of course.
> >
> >it has nothing to do with rhide. it is windows 95.
> *** I don't mean something like "XCOPY" when running XCopy, but RHIDE 
> turns it into "RHIDE Version 1.4 - no project". This can also be found 
> in the properties box.

i realized what you meant later. here's a short program to show how to
do it. 

compile it using:

gcc apptitle.c -o apptitle.exe -Wall

and run it as:

apptitle title1 title2 title3 ... etc

and it displays all the command line arguments in the title bar.

/*
 * 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+1);
	
	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]));
    delay(1000);
  }

  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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019