TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jim Fitzsimmons
from: Gautam Lad
date: 1996-06-10 12:03:40
subject: Writing to Client.

Hi,
Here's a snippet of a code that'll create a frame window, and inside it,
write a string.:
(I ommited the main() since it's same as creating a plain window).

MRESULT EXPENTRY window_func(HWND handle,ULONG mess,MPARAM parm1,MPARAM parm2)
{
HPS p_space;
POINTL coords;

        switch(mess)
        {
        case WM_PAINT:

        p_space=WinBeginPaint(handle,0,NULL);    // handle to presentatin space

        coords.x = 0;                  // coordinates
        coords.y = 0;

        GpiCharStringAt(pspace,&coords,14,"Hello World!"); 

        WinEndPaint(handle);
        break;

        case WM_ERASEBACKGROUND:
        return (MRESULT) TRUE;

        defaut:
                return WinDefWnidowProc(handle,mess,parm1,parm2);
}
return (MRESULT) 0;
}
       
To simply write to a window, use this service:
LONG APIENTRY GpiStringAt(HPS p_space, PPOINTL locatin, LONG size, PCH string);

This service is used above (as you can see).

Hope this helps!

--- Maximus/2 3.00
* Origin: One Less Car * TorontOS/2 * (416) 480-0147 * (1:250/238)
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 517 628 713/888 800/1
@PATH: 250/238 2424/11 24 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™.