共用方式為


DTM_ADDSTYLE

Send Feedback

The DTM_ADDSTYLE message is sent by an application to the HTML viewer control to request that default stylesheet rules be applied to the current HTML window.

Syntax

DTM_ADDSTYLE
  wParam = 0
  lParam = (LPARAM)(LPCWSTR) pszStyle;

Parameters

  • wParam
    Not used.
  • pszStyle
    Reference to a string containing the stylesheet rules to add to the current HTML window.

Return Values

None.

Remarks

Stylesheet rules applied with DTM_ADDSTYLE are reset with the message DTM_CLEAR. Stylesheet rules are also reset with the message DTM_NAVIGATE. Sending DTM_ADDSTYLE messages does not affect pages that are navigated to with the message DTM_NAVIGATE.

The following example shows how you might use this message.

LPCWSTR pszStyle = TEXT("BODY { border-color: red; border-width: 2px; 
                   border-style: solid; }");
SendMessage(hwndHTML, DTM_ADDSTYLE, 0, (LPARAM)pszStyle);

Requirements

Pocket PC: Windows Mobile 2003 and later
Smartphone: Windows Mobile 2003 and later
OS Versions: Windows CE .NET 4.2 and later
Header: htmlctrl.h
Library: htmlctrl.lib

See Also

HTML Control API Messages | DTM_ADDTEXT | DTM_ADDTEXTW | DTM_CLEAR | DTM_ENDOFSOURCE

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.