На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

DLGTEMPLATEEX



The DLGTEMPLATEEX structure is not defined in any standard header file. The structure definition is provided here to explain the format of an extended template for a dialog box.

An extended dialog box template begins with a DLGTEMPLATEEX header that describes the dialog box and specifies the number of controls in the dialog box. For each control in a dialog box, an extended dialog box template has a block of data that uses the DLGITEMTEMPLATEEX format to describe the control.

// typedef struct {
// WORD dlgVer;
// WORD signature;
// DWORD helpID;
// DWORD exStyle;
// DWORD style;
// WORD cDlgItems;
// short x;
// short y;
// short cx;
// short cy;
// sz_Or_Ord menu; // name or ordinal of a menu resource
// sz_Or_Ord windowClass; // name or ordinal of a window class
// WCHAR title[titleLen]; // title string of the dialog box
// short pointsize; // only if DS_SETFONT flag is set

// short weight; // only if DS_SETFONT flag is set
// short bItalic; // only if DS_SETFONT flag is set
// WCHAR font[fontLen]; // typeface name, if DS_SETFONT is set
// } DLGTEMPLATEEX;


Members

dlgVer

Indicates whether a template is an extended dialog box template. A value of 0xFFFF indicates an extended dialog box template. In this case, the signature member specifies the template version number. If dlgVer is any value other than 0xFFFF, this is a standard template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures.

signature

Specifies the version number of the extended dialog box template. This member must specify 1.

helpID

Specifies the help context identifier for the dialog box window. When the system sends a WM_HELP message, it passes this value in the dwContextId member of the HELPINFO structure.

exStyle

Specifies extended styles for a window. This member is not used to create dialog boxes, but applications that use dialog box templates can use it to create other types of windows.

style

Specifies the style of the dialog box. This member can be a combination of window style values (such as WS_CAPTION and WS_SYSMENU) and one or more of the following dialog box style values.

Value Meaning
DS_3DLOOK Gives the dialog box a nonbold font and draws three-dimensional borders around control windows in the dialog box. The DS_3DLOOK style is required only by Win32-based applications compiled for versions of Windows earlier than Windows 95 or Windows NT 4.0. The system automatically applies the three-dimensional look to dialog boxes created by applications compiled for current versions of Windows.
DS_ABSALIGN Indicates that the coordinates of the dialog box are screen coordinates. If this style is not specified, the system treats them as client coordinates.
DS_CENTER Centers the dialog box in the working area; that is, the area not obscured by the tray.
DS_CENTERMOUSE Centers the mouse cursor in the dialog box.
DS_CONTEXTHELP Includes a question mark in the title bar of the dialog box. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. The control should pass the message to the dialog procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the control. Note that DS_CONTEXTHELP is only a placeholder. When the dialog box is created, the system checks for DS_CONTEXTHELP and, if it is there, adds WS_EX_CONTEXTHELP to the extended style of the dialog box. You cannot use the WS_EX_CONTEXTHELP style with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.
DS_CONTROL Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user to tab among the control windows of a child dialog box, use its accelerator keys, and so on.
DS_FIXEDSYS Causes the dialog box to use the SYSTEM_FIXED_FONT instead of the default SYSTEM_FONT. SYSTEM_FIXED_FONT is a monospace font compatible with the System font in Windows versions earlier than 3.0.
DS_LOCALEDIT Applies to 16-bit applications only. This style directs edit controls in the dialog box to allocate memory from the application's data segment. Otherwise, edit controls allocate storage from a global memory object.
DS_MODALFRAME Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and System menu by specifying the WS_CAPTION and WS_SYSMENU styles.
DS_NOFAILCREATE Windows 95 only: Creates the dialog box even if errors occur ѕ for example, if a child window cannot be created or if the system cannot create a special data segment for an edit control.
DS_NOIDLEMSG Suppresses WM_ENTERIDLE messages that Windows would otherwise send to the owner of the dialog box while the dialog box is displayed.
DS_SETFONT Indicates that the DLGTEMPLATEEX header of the extended dialog box template contains four additional members (pointsize, weight, bItalic, and font) that describe the font to use for the text in the client area and controls of the dialog box. If possible, the system creates a font according to the values specified in these members. Then the system passes the handle of the font to the dialog box and to each control by sending them the WM_SETFONT message. If this style is not specified, the extended dialog box template does not include the pointsize, weight, bItalic, and font members.
DS_SETFOREGROUND Causes the system to use the SetForegroundWindow function to bring the dialog box to the foreground.
DS_SYSMODAL Creates a system-modal dialog box. This style causes the dialog box to have the WS_EX_TOPMOST style. Otherwise, it has no effect on the dialog box or the behavior of other windows in the system when the dialog box is displayed.


cDlgItems

Specifies the number of controls in the dialog box.

x

Specifies the x-coordinate, in dialog box units, of the upper-left corner of the dialog box.

y

Specifies the y-coordinate, in dialog box units, of the upper-left corner of the dialog box.

cx

Specifies the width, in dialog box units, of the dialog box.

cy

Specifies the height, in dialog box units, of the dialog box.

menu

Specifies a variable-length array of 16-bit elements that identifies a menu resource for the dialog box. If the first element of this array is 0x0000, the dialog box has no menu and the array has no other elements. If the first element is 0xFFFF, the array has one additional element that specifies the ordinal value of a menu resource in an executable file. If the first element has any other value, the system treats the array as a null-terminated Unicode string that specifies the name of a menu resource in an executable file.

windowClass

Specifies a variable-length array of 16-bit elements that identifies the window class of the dialog box. If the first element of the array is 0x0000, the system uses the predefined dialog box class for the dialog box and the array has no other elements. If the first element is 0xFFFF, the array has one additional element that specifies the ordinal value of a predefined system window class. If the first element has any other value, the system treats the array as a null-terminated Unicode string that specifies the name of a registered window class.

title

Specifies a null-terminated Unicode string that contains the title of the dialog box. If the first element of this array is 0x0000, the dialog box has no title and the array has no other elements.

pointsize

Specifies the point size of the font to use for the text in the dialog box and its controls. The pointsize, weight, bItalic, and font members are present in an extended dialog box template only if the style member specifies the DS_SETFONT style.

weight

Specifies the weight of the font in the range 0 through 1000. This can be any of the values listed for the lfWeight member of the LOGFONT structure. This member is present only if the style member specifies DS_SETFONT.

bItalic

Indicates whether the font is italic. If this value is TRUE, the font is italic. This member is present only if the style member specifies DS_SETFONT.

font

Specifies a null-terminated Unicode string that contains the name of the typeface for the font. This member is present only if the style member specifies DS_SETFONT.



Remarks

You can use an extended dialog box template instead of a standard dialog box template in the CreateDialogIndirectParam and DialogBoxIndirectParam functions and the CreateDialogIndirect and DialogBoxIndirect macros. A standard dialog box template uses the DLGTEMPLATE and DLGITEMTEMPLATE structures.
Following the DLGTEMPLATEEX header in an extended dialog box template is one or more DLGITEMTEMPLATEEX structures that describe the controls of the dialog box. The cDlgItems member specifies the number of DLGITEMTEMPLATEEX structures in the template.

Each DLGITEMTEMPLATEEX structure in the template must be aligned on a DWORD boundary. If the style member specifies the DS_SETFONT style, the first DLGITEMTEMPLATEEX structure begins on the first DWORD boundary after the font string. If DS_SETFONT is not specified, the first structure begins on the first DWORD boundary after the title string.
The menu, windowClass, title, and font arrays must be aligned on WORD boundaries.

If you specify character strings in the menu, windowClass, title, and font arrays, you must use Unicode strings. To create code that works on both Windows NT and Windows 95, use the MultiByteToWideChar function to generate these Unicode strings.
The x, y, cx, and cy members specify values in dialog box units. You can convert these values to screen units (pixels) by using the MapDialogRect function.

See Also

CreateDialogIndirect, CreateDialogIndirectParam, DialogBoxIndirect, DialogBoxIndirectParam, DLGITEMTEMPLATE, DLGITEMTEMPLATEEX, DLGTEMPLATE, MapDialogRect, MultiByteToWideChar, WM_SETFONT


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

DLGTEMPLATEEX



Структура DLGTEMPLATEEX не определена в любом стандартном файле заголовка. Структурное определение предусматривается здесь, чтобы объяснять формат расширенного шаблона для диалогового блока.

Расширенный диалоговый шаблон блока начинает с заголовка DLGTEMPLATEEX, который описывает диалогового блока и определяет количество элементов управления в диалоговом блоке. Для каждого управления в диалоговом блоке, расширенный диалоговый шаблон блока имеет блока данных, которые используют формат DLGITEMTEMPLATEEX, чтобы описывать управление.

// typedef struct { // WORD dlgVer;
// ТЕКСТОВАЯ сигнатура;
// DWORD helpID;
// DWORD exStyle;
// СТИЛЬ DWORD;
// WORD cDlgItems;
// перемычка x;
// перемычка y;
// перемычка cx;
// перемычка cy;
// меню sz_Or_Ord; // имя или порядковое ресурса / меню/ sz_Or_Ord windowClass; // имя или порядковое класса / окна/ WCHAR называют[titleLen]; // строка названия диалогового блока // перемычка pointsize; // только если флаг DS_SETFONT установлен

// короткий вес; // только если флаг DS_SETFONT установлен // перемычка bItalic; // только если флаг DS_SETFONT установлен // шрифт WCHAR[fontLen]; // тип шрифта имени, если DS_SETFONT установлен // } DLGTEMPLATEEX;


Участники

dlgVer

Указывает является шаблон расширенным диалоговым шаблоном блока. Величина 0xFFFF указывает расширенный диалоговый шаблон блока. В этом случае, элемент сигнатуры определяет номер версии шаблона. Если dlgVer - любая величина кроме 0xFFFF, это - стандартный шаблон, который использует DLGTEMPLATE и структуры DLGITEMTEMPLATE.

сигнатура

Определяет номер версии расширенного диалогового шаблона блока. Этот элемент должен определить 1.

helpID

Определяет контекстный идентификатор подсказки для диалогового окна блока. Когда система посылает сообщение WM_HELP, она передает эту величину в элемент dwContextId структуры HELPINFO.

exStyle

Определяет расширенные стили для окна. Этот элемент не использован, чтобы создавать диалоговых блоков, но приложений, которые используют диалоговые шаблоны блока могут использовать это, чтобы создавать другие типы окна.

стиль

Определяет стиль диалогового блока. Этот элемент может быть комбинацией величин стиля окна (как например, WS_CAPTION и WS_SYSMENU) и одно или более из следующего общаются блок величин стиля.

Значение Величины
DS_3DLOOK Дает диалоговому блоку шрифт nonbold и делает трехмерными границами вокруг управляющего окна в диалоговом блоке. Стиль DS_3DLOOK требуется только базирующимися приложениями Win32 компилированными для версий Windows раньше чем Windows 95 или Windows NT 4.0. Система автоматически прилагает трехмерный взгляд, чтобы общаться блоки созданные приложениями компилированными для текущих версий Windows.
DS_ABSALIGN Указывает, что координаты диалогового блока являются экранными координатами. Если этот стиль не определен, система обрабатывает ее как координаты клиента.
DS_CENTER Центрирует диалогового блока в рабочей области; то есть, область не затемнялась поддоном.
DS_CENTERMOUSE Центрирует курсор мыши в диалоговом блоке.
DS_CONTEXTHELP Включает знак вопроса в зону названия диалогового блока. Когда пользователь щелкает знак вопроса, курсор изменяется в знак вопроса с указателем. Если пользователь, тогда щелкает управление в диалоговый блока, управление получает сообщение WM_HELP. Управление должно передавать сообщение в диалоговую процедуру, которое должно вызывать функцию WinHelp, использовавшую команду HELP_WM_HELP. Приложение Подсказки отображает управляющее окно, которое обычно содержит подсказку для управления. Отметьте, что DS_CONTEXTHELP - только метка-заполнитель. Когда диалоговый блок создан, система проверяет на наличие DS_CONTEXTHELP и, если она - там, добавляет WS_EX_CONTEXTHELP к расширенному стилю диалогового блока. Вы не можете использовать стиль WS_EX_CONTEXTHELP с WS_MAXIMIZEBOX или стилями WS_MINIMIZEBOX.
DS_CONTROL Создает диалогового блока, который прокладывает хорошо как окно ребенка другого диалогового блока, очень похожий страница на листе свойства. Этот стиль допускает пользователя в таб. среди управляющего окна диалогового блока ребенка, использует свои клавиши акселератора, и так далее.
DS_FIXEDSYS Заставляет диалогового блока, чтобы использовать SYSTEM_FIXED_FONT вместо по умолчанию SYSTEM_FONT. SYSTEM_FIXED_FONT - шрифт интервала совместимый с шрифтом Системы в версиях Windows раньше чем 3.0.
DS_LOCALEDIT Относится к 16- битовым приложениям только. Этот стиль направляет элементы управления редактирования в диалоговом блоке, чтобы распределять память из прикладного сегмента данных. В противном случае, элементы управления редактирования распределяют память с глобального объекта памяти.
DS_MODALFRAME Создает диалогового блока с диалоговым блоком модального фрейма, который может быть объединен зоной названия и меню Системы определяя WS_CAPTION и стили WS_SYSMENU.
DS_NOFAILCREATE Windows 95 только: Создает диалогового блока даже если бы ошибки происходят U например, если окно ребенка не может быть создано или если система не может создать специальный сегмент данных для управления редактирования.
DS_NOIDLEMSG Подавляет сообщения WM_ENTERIDLE, что Windows было бы в противном случае посылаться владельцу диалогового блока тогда как диалоговый блок отображен.
DS_SETFONT Указывает, что заголовок DLGTEMPLATEEX расширенного диалогового шаблона блока содержит четыре дополнительных участника (pointsize, вес, bItalic, и шрифт), что описывать шрифт, чтобы использоваться для текста в области клиента и управления диалоговым блоком. Если возможно, система создает шрифт в зависимости от того величины определялись на этих участниках. Затем система передает ручку шрифта диалоговому блоку и на каждое управление посылая им сообщение WM_SETFONT. Если этот стиль не определен, расширенный диалоговый шаблон блока не включает pointsize, нагрузите, bItalic, и шрифтовые участники.
DS_SETFOREGROUND Заставляет систему, чтобы использовать функцию SetForegroundWindow, чтобы переносить диалогового блока на передний план.
DS_SYSMODAL Создает системного-модального диалогового блока. Этот стиль заставляет диалогового блока, чтобы иметь стиль WS_EX_TOPMOST. В противном случае, у него нет эффекта на диалоговом блоке или поведение другого окна в системе когда диалоговый блок отображен.


cDlgItems

Определяет количество элементов управления в диалоговом блоке.

x

Определяет x-coordinate, на диалоговых устройствах блока, верхнего левого угла диалогового блока.

y

Определяет y-coordinate, на диалоговых устройствах блока, верхнего левого угла диалогового блока.

cx

Определяет ширину, на диалоговых устройствах блока, диалогового блока.

cy

Определяет высоту, на диалоговых устройствах блока, диалогового блока.

меню

Определяет переменную длину массива 16- битовых элементов, которая идентифицирует ресурс меню для диалогового блока. Если первый элемент этого массива - 0x0000, диалоговый блок не имеет меню и массив не имеет другие элементы. Если первый элемент - 0xFFFF, массив имеет один дополнительный элемент, который определяет порядковую величину ресурса меню в выполняемом файле. Если первый элемент имеет любую другую величину, система рассматривает массив как недействительный расторгнутую строку Уникода, которая определяет имя ресурса меню в выполняемом файле.

windowClass

Определяет переменную длину массива 16- битовых элементов, которая идентифицирует класс окна диалогового блока. Если первый элемент массива - 0x0000, система использует встроенный диалоговый класс блока для диалогового блока и массив не имеет другие элементы. Если первый элемент - 0xFFFF, массив имеет один дополнительный элемент, который определяет порядковую величину встроенного системного класса окна. Если первый элемент имеет любую другую величину, система рассматривает массив как недействительный расторгнутую строку Уникода, которая определяет имя зарегистрированного класса окна.

название

Определяет недействительный расторгнутую строку Уникода, которая содержит название диалогового блока. Если первый элемент этого массива - 0x0000, диалоговый блок не имеет название и массив не имеет другие элементы.

pointsize

Определяет размер точки шрифта, чтобы использоваться для текста в диалоговом блоке и элементах управления. pointsize, Вес, bItalic, и шрифтовые участники присутствуют в расширенном диалоговом шаблоне блока только если элемент стиля определяет стиль DS_SETFONT.

вес

Определяет вес шрифта в дипазоне 0 по 1000. Это может быть любой из величин указанных для элемента lfWeight структуры LOGFONT. Этот элемент присутствует только если элемент стиля определяет DS_SETFONT.

bItalic

Указывает является шрифт курсивом. Если эта величина является ИСТИНОЙ, шрифт является курсивом. Этот элемент присутствует только если элемент стиля определяет DS_SETFONT.

шрифт

Определяет недействительный расторгнутую строку Уникода, которая содержит имя типа шрифта для шрифта. Этот элемент присутствует только если элемент стиля определяет DS_SETFONT.



Замечания

Вы можете использовать расширенный диалоговый шаблон блока вместо стандартного диалогового шаблона блока в CreateDialogIndirectParam и функции DialogBoxIndirectParam и CreateDialogIndirect и макро DialogBoxIndirect. Стандартный диалоговый шаблон блока использует DLGTEMPLATE и структуры DLGITEMTEMPLATE.
Следующее заголовка DLGTEMPLATEEX в расширенном диалоговом шаблоне блока - одна или более структур DLGITEMTEMPLATEEX, которые описывают управление диалоговым блоком. Элемент cDlgItems определяет число структур DLGITEMTEMPLATEEX в шаблоне.

Каждая структура DLGITEMTEMPLATEEX в шаблоне должна быть выровнена на границе DWORD. Если элемент стиля определяет стиль DS_SETFONT, первая структура DLGITEMTEMPLATEEX начинается на первой границе DWORD после шрифтовой строки. Если DS_SETFONT не определен, первая структура начинается на первой границе DWORD после строки названия.
Меню, windowClass, название, и шрифт подготавливает, должны быть выровнены на ТЕКСТОВЫХ границах.

Если Вы определяете символьные строки в меню, windowClass, назовитесь, и шрифт подготавливается, Вы должны использовать строки Уникода. Для того, чтобы создавать код, который работает на как Windows NT так и Windows 95, используйте функцию MultiByteToWideChar, чтобы генерировать эти строки Уникода.
x, y, cx, И cy участники определяют величины на диалоговых устройствах блока. Вы можете преобразовать эти величины, чтобы отгораживать устройства (пиксели) используя функцию MapDialogRect.

Смотри Также

CreateDialogIndirect, CreateDialogIndirectParam, DialogBoxIndirect, DialogBoxIndirectParam, DLGITEMTEMPLATE, DLGITEMTEMPLATEEX, DLGTEMPLATE, MapDialogRect, MultiByteToWideChar, WM_SETFONT


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz