TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Doug Nazar
date: 1996-09-04 12:01:40
subject: Window Title

Hello Phil!

Tuesday September 03 1996 08:28, Phil Crown wrote to Doug Nazar:

DN>> I did a little checking and could find no docs on WinSetTitle but
DN>> found it in OS2386.LIB so I guessed at the prototype and voila!
PC>                     ^^^
PC> You mean os2286.lib?

No. I'm using a 32-bit compilier calling 16 bit functions. They are
referenced in os2386.lib.  os2286.lib is for 16 bit compiliers.

PC> Which compiler are you using?  I tried bcc and gcc, neither works.

I was using IBM VAC++. However, I went back and did it with EMX. I don't
have borland so am unable to test anything.

PC> bcc title.c os2286.lib

PC> Warning title.c 43: Call to function 'WinSetTitle' with no prototype
PC> in function main
PC> Turbo Link  Version 1.5 for OS/2 Copyright (c) 1994 Borland International
PC> Error: Unresolved external '_WinSetTitle' referenced from module title.c

Does Borland produce 32 bit code? if so you need to call WIN16SETTITLE from
OS2386.LIB using the system calling convention (borland might have another
word for it).

PC> gcc title.c

PC> g:\Tmp\n\cca03991: Undefined symbol _WinSetTitle referenced from text
PC> segment

Here's how I did it with EMX.

gcc -Zomf test.c test.def

-- CUT -------- Begin test.c -------- CUT --
#include 
#include 

#define USE_OS2_TOOLKIT_HEADERS
#define INCL_WIN
#include 

#ifdef __cplusplus
extern "C"
{
#endif


#ifdef __EMX__
USHORT _THUNK_FUNCTION (Win16SetTitle) (HAB hab, PSZ title);

USHORT WinSetTitle(HAB hab, PSZ title)
{
   _THUNK_PROLOG(4 + 4);
   _THUNK_LONG(hab);
   _THUNK_FAR16(_emx_32to16(title));
   _THUNK_CALL(Win16SetTitle);
}
#else

#define WinSetTitle WIN16SETTITLE
   APIRET16 APIENTRY16 WinSetTitle (HAB hab,
                                    PSZ title);

#endif


#ifdef __cplusplus
}
#endif


int main(int argc, char* argv[])
{
   if (argc > 1)
      WinSetTitle(0, argv[1]);

   getch();

   return 0;
}

-- CUT --------- End test.c --------- CUT --


-- CUT -------- Begin test.def -------- CUT --
NAME TEST WINDOWCOMPAT
IMPORTS
 _16_Win16SetTitle = PMSHAPI.93
-- CUT --------- End test.def --------- CUT --


Doug

--- GoldED/2 3.00.Alpha1+
* Origin: Realm of the Dragons - `Where thy mind hath no limits' (1:250/516)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 250/516 101 99 3615/50 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.