TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gary Chambers
from: Peter Fitzsimmons
date: 1996-02-22 03:00:40
subject: Writing directly to a dialog

GC> Is there anyway (not that it's absolutely necessary) 
 GC> to dynamically add text to a dialog?  I have tried 
 GC> using WinGetPS / GpiCharStringAt and WinDrawText / 
 GC> WinReleasePS with no luck.  After many hours of

You shouldn't draw/paint onto a dialog directly.

 GC> scouring my somewhat limited textual resources, I 
 GC> happened upon WinSetWindowText (and placing blank 
 GC> windows with identifiers in the resource file).

You found the solution.

If you have non-text stuff you want to draw on a dialog, create a
user-defined control -- this is _not_ that hard,  and I have a sample
kicking around (animated icon control) kicking around if someone wants it.

In the resource file,  the control is defined with the name of the window
class as a parameter.  In your code,  you WinRegisterClass() the class, 
and get the WM_CREATE when the dialog is created,  and any other message
(WM_PAINT,  for example) when required.  Your code never has to know that
it was called by a dialog -- it could have been called by WinCreateWindow()
for all it cares.


--- Maximus/2 3.00
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 396/1 270/101 712/515 711/808 809 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™.