Renaming Compile Results Window with a PWB Extension

Last reviewed: July 17, 1997
Article ID: Q81322
1.00 1.10 2.00 MS-DOS kbtool kbcode

The information in this article applies to:

  • Microsoft Programmer's Workbench for MS-DOS, versions 1.0, 1.1, and 2.0

SUMMARY

The following article describes how to rename the Compile Results window in the Programmer's WorkBench (PWB) versions 1.0 and 1.1.

MORE INFORMATION

This is possible because PWB references only the name of the pseudofile that is contained in <>, and whatever comes after that will be displayed as the title of the window. This is illustrated by the following sample.

To rename the Compile Results window:

  1. First compile and link the sample code.

  2. Place the resulting .MXT file in the same directory as PWB. This will normally be the BIN subdirectory.

  3. Add the following lines to the TOOLS.INI file under the [pwb] tag to make the function funcname() accessible in PWB by using the ALT+Z keystroke:

          load:[programname]
          funcname:alt+z
    

  4. After starting PWB, invoke the extension by entering ALT+Z.

MORE information about PWB extensions can be found in Chapter 8 of the "Microsoft C Advanced Programming Techniques" manual, the online help, and in Chapter 9 of the C versions 6.x "Developers Toolkit Reference."

Sample Code

/* Compile and link options needed:
        cl /c /ACw /Gs [programname].c
        link exthdr.obj [programname].obj, [programname].mxt;  */


#include "ext.h"

/* function prototype */
PWBFUNC funcname(unsigned argData,
                 ARG _far *pArg,
                 flagType fMeta);

/* switch description table (required for an extension) */
struct swiDesc swiTable[] = { { NULL,NULL,0}};

/* command description table ( required for a pwb extension) */
struct cmdDesc cmdTable[] ={ { "funcname", funcname, 0 , NOARG},
                                { NULL, NULL, 0, 0}};

/* function that PWB calls when loading the extension */
void EXTERNAL WhenLoaded(void)
{
        DoMessage("Loading funcname extension");
}

PWBFUNC funcname(unsigned argData,
                        ARG _far *pArg,
                        flagType fMeta)
{
        PFILE pFileCompile;
        char szNewName[] = "<COMPILE>New Name for Window";

        if((pFileCompile = FileNameToHandle("<COMPILE>",NULL))!=PNULL)
           SetEditorObject(RQ_FILE_NAME | 0xff, pFileCompile,

   szNewName);
}


Additional reference words: kbinf 1.00 1.10 2.00 PWBIss
KBCategory: kbtool kbcode
KBSubcategory: PWBIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.