🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1965

Re: PRESENTATION MANAGER QUESTION

#1965
From: Michael Harris
Date: Thu, 08 Oct 1992 22:07
67 lines
3052 bytes
uma@natinst.com (Uma Arunkumar) writes:

>****************** PM QUESTION in OS2 2.0************************
>I am just trying to create a child window.  
>I have created a main window with frame, sysmenu, scroll bar, 
>minimize maximize buttons etc using WinCreateStdWindow.  
>This window displays the company logo and product information.
>I have used some simple graphics functions.  
>As soon as the user hits any key, the next screen should be displayed.

>The questions are given below:
>(i) Do I have to create a child window or repaint the same window with the new textual information?

You can do it either way.  In essence, you are creating a child window...
the Client window that appears on top of the frame and between the menu and
scrollbars.

>(ii) HOW SHOULD I CREATE A CHILD WINDOW? 

Child windows are created using WinCreateWindow().  A child window is simply
a window who has a parent and/or owner.  (Depending upon what behavior you
want.)

>(iii) HOW SHOULD I REPAINT AN EXISTING WINDOW?

If you want to force an existing window to repaint, call WinInvalidateRect()
and pass a NULL pointer in for the rectangle.

>(iv)   I tried giving 
>         WinPostMessage(hwnd, WM_ERASEWINDOW, (MPARAM) 0, (MPARAM)0);
>in order to clear the window so that I can put new textual
>information on the same window.  But the compiler complains
>that WM_ERASEWINDOW should be declared.  ( I had defined INCL_WIN, INCL_GPI).

The best thing for you to do in this case is to draw your logos and other
things while your client window is processing WM_PAINT.  It should look
something like this:

/* Warning!  PSEUDOCODE */
case WM_PAINT:
{
HPS hps;

hps=WinBeginPaint();

/* The following calls aren't necessary if you are happy with the default */
/* Background color and you are trapping WM_ERASEBACKGROUND and returning */
/* TRUE */ 
WinQueryWindowRect();
WinFillRect();        /* clear background */

WinDrawBitmap();
WinDrawText();

WinEndPaint();
}

Now, that is really sketchy, but it is a start.  You will need to load the
bitmap via WinLoadBitmap() from a resource and specify the bitmap handle
to WinDrawBitmap.

Hope this helps!

______________________________________________________________________________
     Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
 System Administrator, Computer & Technologies Theme Program, NC State Univ.
(My opinions are my own and do not represent those of NCSU or IBM Corporation)
Technical Details
Message-ID: <harris.718582025@garfield.catt.ncsu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!news.byu.edu!gatech!concert!rock!taco!garfield.catt.ncsu.edu!harris
References: <1auvr1INNjg0@falcon.natinst.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!eff!news.byu.edu!gatech!concert!rock!taco!garfield.catt.ncsu.edu!harris
From: harris@garfield.catt.ncsu.edu (Michael Harris)
Subject: Re: PRESENTATION MANAGER QUESTION
Message-ID: <harris.718582025@garfield.catt.ncsu.edu>
Sender: news@ncsu.edu (USENET News System)
Organization: North Carolina State University
References: <1auvr1INNjg0@falcon.natinst.com>
Date: Thu, 8 Oct 1992 22:07:05 GMT
Lines: 67