Path: 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 > 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