This message is sent by an application to determine the layout width (in pixels) of the client area.
The layout width number changes depending on whether a scroll bar appears (changing the width of the client area), and it is independent of the characters and strings that are being added to the page.
When the text width is larger than the client area (for example a large word than can not be wrapped), this message returns the width (in pixels) occupied by the text.
When the text width is smaller than the client area, this message returns the width (in pixels) of the client area.
If there is a blank page or when "blank page" == DTM_CLEAR, both width and height should be 0 and DTM_LAYOUTWIDTH returns 0.
The following example shows how you might use this message.
lWidth=SendMessage(hWndCtrl, DTM_LAYOUTWIDTH, 0, 0);