Article View: comp.windows.ms
Article #13866Re: drawing inside dialog boxes
From: Bill Turner
Date: Wed, 20 Dec 1989 17:25
Date: Wed, 20 Dec 1989 17:25
22 lines
1223 bytes
1223 bytes
> Hi, is it possible to draw inside a dialog box, i.e. I want to draw a
> blue rectangle inside a dialog box and change its color according to dialog
> commands, but for some reason every time I try to draw it I get nothing,
> here is what I do:
> case WM_INITDIALOG:
> hDC = GetDC(hDlg);
> .
> .
>
> Rectangle(hDC, x1, y1, x2, y2);
You probably want to handle the WM_PAINT message. WM_INITDIALOG just says
that all the windows related to the dialog have been created, but they haven't
been displayed yet.
Another possibility is to create a window class that simply draws itself with
a specified color, and use that as a field in the dialog box:
CONTROL text, id, YOUR_CLASS, style, x, y, w, h
--Bill Turner (bturner@hp-pcd.hp.com)
HP Corvallis Information Systems
Technical Details
Message-ID:
<106580079@hpcvlx.cv.hp.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!bturnerReferences:
<33325@ucbvax.BERKELEY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.cv.hp.com (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: drawing inside dialog boxes Message-ID: <106580079@hpcvlx.cv.hp.com> Date: 20 Dec 89 17:25:25 GMT References: <33325@ucbvax.BERKELEY.EDU> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 22