Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WM_PAINT and Dialog Boxes

Status
Not open for further replies.

cdgios

Technical User
Jul 17, 2002
40
US
Hello All,

I am looking at an example from charles petzold's book ("Programming Windows", Fifth Edition, Chapter 11, Figure 11-3. "the ABOUT2 program") in which the initial static text control painting is not done in response to the WM_INITDIALOG message. Instead he handles the WM_PAINT message in the dialog box procedure and paints the static text control there. So, I was wondering if after the DialogBox() function is called (from the main application window's procedure) to create the dialog box, Windows sends the dialog box procedure the WM_PAINT message soon after it sends the WM_INITDIALOG message. How else is the static text control on the dialog box painted initially according to this example program in his book?.

I understand that incase of a regular window (main application window), the WinMain() calls UpdateWindow () which causes WM_PAINT to be sent to the window procedure where initial painting can be done. I am trying to understand how this is done in case of dialog boxes.

Thanks
Best Regards
Chandra
 

Windows handles Dialogs(and controlls) like windows.
So a Window get the WM_PAINT-Message afer the WM_SIZE-Message when it will be initialisied.
The WM_INITDIALOG comes before the WM_SIZE-Message, so the size of the window(or controll) is still zero.

Messagesorder send to the window (partial)

WM_INITDIALOG
WM_SIZE
WM_PAINT




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top