L_PntDlgText
#include "ltpdg.h"
L_INT EXT_FUNCTION L_PntDlgText(hWnd, pTextDlgInfo)
HWND hWnd; |
/*owner of the dialog */ |
pPAINTDLGTEXTINFO pTextDlgInfo; |
/* pointer to a structure */ |
Brings up the text properties dialog box.
Parameter |
Description |
hWnd |
Handle of the window that owns the dialog. |
pTextDlgInfo |
Pointer to a PAINTDLGTEXTINFO structure that contains text information. The values present in pTextDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_TEXT_INITUSEDEFAULT is not set in the dwFlags member of pTextDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Required DLLs and Libraries
LTPDG For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
|
Topics: |
|
|
Example
// This example will display the Text common dialog
L_TCHAR * g_ppszBackgroundTileBitmap [ ] = { TEXT("Tile 0"), TEXT("Tile 1"), TEXT("Tile 2"),
TEXT("Tile 3"), TEXT("Tile 4"), TEXT("Tile 5") };
PAINTDLGTEXTINFO g_DlgTextInfo ;
L_VOID TextDlgTest ( HWND hWnd, L_BOOL fUseDef )
{
LOGFONT lf ;
PAINTTRANSFORM Painttransform ;
if ( fUseDef == TRUE )
{
g_DlgTextInfo.dwFlags = PAINT_DLG_TEXT_INITUSEDEFAULT | PAINT_DLG_TEXT_SHOWALL ;
}
else
{
lf.lfHeight = 48;
lf.lfWidth = 0 ;
lf.lfEscapement = 0 ;
lf.lfOrientation = 0 ;
lf.lfWeight = FW_NORMAL ;
lf.lfItalic = FALSE ;
lf.lfUnderline = FALSE ;
lf.lfStrikeOut = FALSE ;
lf.lfCharSet = ANSI_CHARSET ;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS ;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS ;
lf.lfQuality = DEFAULT_QUALITY ;
lf.lfPitchAndFamily = FF_DONTCARE ;
lstrcpy(lf.lfFaceName, TEXT("Times New Roman") ) ;
Painttransform.nRotate = 45 ;
Painttransform.Scale.cx = 200 ;
Painttransform.Scale.cy = 200 ;
g_DlgTextInfo.nSize = sizeof ( PAINTDLGTEXTINFO ) ;
g_DlgTextInfo.dwFlags = PAINT_DLG_TEXT_SHOWTEXT |
PAINT_DLG_TEXT_SHOWBKGRNDSTYLE |
PAINT_DLG_TEXT_SHOWBKGRNDOPAQUECOLOR |
PAINT_DLG_TEXT_SHOWBKGRNDTILE |
PAINT_DLG_TEXT_SHOWBORDERWIDTH |
PAINT_DLG_TEXT_SHOWBORDERCOLOR |
PAINT_DLG_TEXT_SHOWHORZALIGNMENT |
PAINT_DLG_TEXT_SHOWVERTALIGNMENT |
PAINT_DLG_TEXT_SHOWROTATE |
PAINT_DLG_TEXT_SHOWSCALE |
PAINT_DLG_TEXT_SHOWTRUETYPEFONT |
PAINT_DLG_TEXT_SHOWOPACITY |
PAINT_DLG_TEXT_SHOWDEFAULT;
g_DlgTextInfo.pszTitle = TEXT("Lead Text Common Dialog ") ;
g_DlgTextInfo.pszText = TEXT("Test Test Test");
g_DlgTextInfo.logFont = lf ;
g_DlgTextInfo.nBorderWidth = 10 ;
g_DlgTextInfo.crBorderColor = RGB ( 0, 0, 255 ) ;
g_DlgTextInfo.nBackgroundStyle = PAINT_TEXT_BACK_STYLE_TILEDIMAGE ;
g_DlgTextInfo.crBackgroundColor = RGB ( 255, 0, 0 ) ;
g_DlgTextInfo.ppszBackgroundTileBitmap = g_ppszBackgroundTileBitmap ;
g_DlgTextInfo.uBackgroundTileBitmapCount = 6 ;
g_DlgTextInfo.nActiveBackgroundTileBitmapItem= 2 ;
g_DlgTextInfo.nAlignment = ( PAINTALIGNMENT ) ( PAINT_ALIGNMENT_RIGHT | PAINT_ALIGNMENT_VCENTER ) ;
g_DlgTextInfo.nOpacity = 10 ;
g_DlgTextInfo.TransformInfo = Painttransform ;
}
L_PntDlgText ( hWnd, &g_DlgTextInfo ) ;
return ;
}