00561 {
00562 HWND hwnd;
00563 HWND hwnd2;
00564
PWND pwnd;
00565 HWND hwndNewFocus;
00566 HWND hwndEditFirst =
NULL;
00567 RECT rc;
00568 WORD w;
00569
UTCHAR *lpszMenu,
00570 *lpszClass,
00571 *lpszText,
00572 *lpCreateParams,
00573 *lpStr;
00574
int cxChar,
00575 cyChar;
00576
BOOL f40Compat;
00577 HFONT hNewFont =
NULL;
00578 HFONT hOldFont;
00579 LPDLGITEMTEMPLATE lpdit;
00580 HMENU hMenu;
00581
BOOL fSuccess;
00582
BOOL fWowWindow;
00583 HANDLE hmodCreate;
00584 LPBYTE lpCreateParamsData;
00585 DLGTEMPLATE2
dt;
00586 DLGITEMTEMPLATE2 dit;
00587
DWORD dwExpWinVer;
00588
DWORD dsStyleOld;
00589
DWORD bFlags = 0;
00590 HDC hdcDlg;
00591
LARGE_STRING strClassName;
00592
PLARGE_STRING pstrClassName;
00593
LARGE_STRING strWindowName;
00594
PMONITOR pMonitor;
00595
00596 UNREFERENCED_PARAMETER(cb);
00597
00598
ConnectIfNecessary();
00599
00600 UserAssert(!(fSCDLGFlags & ~(SCDLG_CLIENT|SCDLG_ANSI|SCDLG_NOREVALIDATE|SCDLG_16BIT)));
00601
00602
00603
00604
00605
if (((LPDLGTEMPLATE2)lpdt)->wSignature == 0xffff) {
00606
00607 UserAssert(((LPDLGTEMPLATE2)lpdt)->wDlgVer <= DLGRSC_VER_NT5COMPAT_RESERVE);
00608 RtlCopyMemory(&dt, lpdt,
sizeof dt);
00609 }
else {
00610
dt.wDlgVer = 0;
00611
dt.wSignature = 0;
00612
dt.dwHelpID = 0;
00613
dt.dwExStyle = lpdt->dwExtendedStyle;
00614
dt.style = lpdt->style;
00615
dt.cDlgItems = lpdt->cdit;
00616
dt.x = lpdt->x;
00617
dt.y = lpdt->y;
00618
dt.cx = lpdt->cx;
00619
dt.cy = lpdt->cy;
00620 }
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634 dsStyleOld = LOWORD(
dt.style);
00635
00636
00637
00638
00639
00640 dwExpWinVer =
GETEXPWINVER(hmod);
00641
00642
if ( f40Compat =
Is400Compat(dwExpWinVer) ) {
00643
dt.style &= (DS_VALID40 | 0xffff0000);
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
if (
GETAPPVER() <
VER40) {
00657
if (
dt.style & DS_COMMONDIALOG) {
00658
dt.style &= ~DS_3DLOOK;
00659 dsStyleOld &= ~DS_3DLOOK;
00660 }
00661 }
else {
00662
dt.style |= DS_3DLOOK;
00663 dsStyleOld |= DS_3DLOOK;
00664 }
00665 }
else {
00666
#if DBG
00667
if (
dt.style != (
dt.style & (DS_VALID31 | DS_3DLOOK | 0xffff0000))) {
00668 RIPMSG1(RIP_WARNING,
"CreateDialog: stripping invalid bits %lX",
dt.style);
00669 }
00670
#endif // DBG
00671
00672
00673
00674
00675
00676
00677
00678 }
00679
00680
if (LOWORD((ULONG_PTR)hmod) == 0) {
00681
if (
dt.style & DS_SETFOREGROUND)
00682 bFlags |=
CD_SETFOREGROUND;
00683 }
00684
00685
if (dsStyleOld != LOWORD(
dt.style))
00686 {
00687
00688 RIPMSG1(f40Compat ? RIP_ERROR : RIP_WARNING,
00689
"Bad dialog style bits (%x) - please remove.",
00690 LOWORD(
dt.style));
00691
00692
00693
if (f40Compat) {
00694
return NULL;
00695 }
00696 }
00697
00698
if (
dt.style & DS_MODALFRAME) {
00699
dt.dwExStyle |= WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE;
00700 }
00701
00702
if ((
dt.style & DS_CONTEXTHELP) && f40Compat) {
00703
dt.dwExStyle |= WS_EX_CONTEXTHELP;
00704 }
00705
00706
if (
dt.style & DS_CONTROL) {
00707
00708
00709
dt.style &= ~(WS_CAPTION | WS_SYSMENU | DS_SYSMODAL);
00710 }
else if (
dt.style & WS_DLGFRAME) {
00711
00712
dt.dwExStyle |= WS_EX_WINDOWEDGE;
00713 }
00714
00715
if (
dt.style & DS_SYSMODAL) {
00716
dt.dwExStyle |= WS_EX_TOPMOST;
00717 }
00718
00719
if (!(
dt.style & WS_CHILD) || (
dt.style & DS_CONTROL)) {
00720
00721
00722
dt.dwExStyle |= WS_EX_CONTROLPARENT;
00723 }
00724
00725
if (
dt.x == (
short)
CW2_USEDEFAULT) {
00726 bFlags |=
CD_USEDEFAULTX;
00727
dt.x = 0;
00728 }
00729
00730
if (
dt.cx == (
short)
CW2_USEDEFAULT) {
00731 bFlags |=
CD_USEDEFAULTCX;
00732
dt.cx = 0;
00733 }
else if (
dt.cx < 0) {
00734
dt.cx = 0;
00735 }
00736
00737
if (
dt.cy < 0) {
00738
dt.cy = 0;
00739 }
00740
00741
00742
00743 lpszMenu = (LPWSTR)(((
PBYTE)(lpdt)) + (
dt.wDlgVer ?
sizeof(DLGTEMPLATE2):
sizeof(DLGTEMPLATE)));
00744
00745
00746
00747
00748
00749 w = *(LPWORD)lpszMenu;
00750
00751
00752
00753
00754
if (w != 0) {
00755
if ((hMenu = LoadMenu(hmod, (w == 0xFFFF) ?
00756 MAKEINTRESOURCE(*(WORD *)((PBYTE)lpszMenu + 2)) : lpszMenu)) ==
NULL) {
00757 RIPMSG0(RIP_WARNING,
"ServerCreateDialog() failed: couldn't load menu");
00758
goto DeleteFontAndMenuAndFail;
00759 }
00760 }
else {
00761 hMenu =
NULL;
00762 }
00763
00764
if (w == 0xFFFF) {
00765 lpszClass = (LPWSTR)((LPBYTE)lpszMenu + 4);
00766 }
else {
00767 lpszClass = (
UTCHAR *)
WordSkipSz(lpszMenu);
00768 }
00769
00770 lpszText = (
UTCHAR *)
WordSkipSz(lpszClass);
00771
00772 lpStr = (
UTCHAR *)
WordSkipSz(lpszText);
00773
00774 hdcDlg = CreateCompatibleDC(NULL);
00775
if (hdcDlg ==
NULL)
00776
goto DeleteFontAndMenuAndFail;
00777
00778
if (
dt.style & DS_SETFONT) {
00779 hNewFont =
CreateDlgFont(hdcDlg, &lpStr, &dt, dwExpWinVer, fSCDLGFlags);
00780 bFlags |=
CD_USERFONT;
00781 lpdit = (LPDLGITEMTEMPLATE)
NextDWordBoundary(lpStr);
00782 }
else if (
Is400Compat(dwExpWinVer) && (
dt.style & DS_FIXEDSYS)) {
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792 hNewFont = GetStockObject(SYSTEM_FIXED_FONT);
00793 bFlags |=
CD_USERFONT;
00794 lpdit = (LPDLGITEMTEMPLATE)
NextDWordBoundary(lpStr);
00795 }
else {
00796 lpdit = (LPDLGITEMTEMPLATE)
NextDWordBoundary(lpStr);
00797 }
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
if (hNewFont && (hOldFont = SelectFont(hdcDlg, hNewFont))) {
00811
00812 cxChar = GdiGetCharDimensions(hdcDlg, NULL, &cyChar);
00813
00814 SelectFont(hdcDlg, hOldFont);
00815
if (cxChar == 0) {
00816 RIPMSG0(RIP_WARNING,
"InternalCreateDialog: GdiGetCharDimensions failed");
00817
goto UseSysFontMetrics;
00818 }
00819 }
00820
else
00821 {
00822
if (hNewFont || (bFlags &
CD_USERFONT))
00823 hNewFont =
ghFontSys;
00824
00825 UseSysFontMetrics:
00826 cxChar =
gpsi->cxSysFontChar;
00827 cyChar =
gpsi->cySysFontChar;
00828 }
00829 DeleteDC(hdcDlg);
00830
00831
if (
dt.style & WS_VISIBLE) {
00832 bFlags |=
CD_VISIBLE;
00833
dt.style &= ~WS_VISIBLE;
00834 }
00835
00836
if (!(
dt.style & DS_LOCALEDIT)) {
00837 bFlags |=
CD_GLOBALEDIT;
00838 }
00839
00840
00841
00842 rc.left = rc.top = 0;
00843 rc.right =
XPixFromXDU(
dt.cx, cxChar);
00844 rc.bottom =
YPixFromYDU(
dt.cy, cyChar);
00845
00846
_AdjustWindowRectEx(&rc,
dt.style, w,
dt.dwExStyle);
00847
00848
dt.cx = (
SHORT)(rc.right - rc.left);
00849
dt.cy = (
SHORT)(rc.bottom - rc.top);
00850
00851
if ((
dt.style & DS_CENTERMOUSE) &&
SYSMET(MOUSEPRESENT) && f40Compat) {
00852 pMonitor =
_MonitorFromPoint(
gpsi->ptCursor, MONITOR_DEFAULTTONULL);
00853 UserAssert(pMonitor);
00854 *((LPPOINT)&rc.left) =
gpsi->ptCursor;
00855 rc.left -= (
dt.cx / 2);
00856 rc.top -= (
dt.cy / 2);
00857 }
else {
00858
BOOL fNoDialogMonitor;
00859
00860 pMonitor =
GetDialogMonitor(hwndOwner, MONITOR_DEFAULTTONULL);
00861 fNoDialogMonitor = pMonitor ?
FALSE :
TRUE;
00862
if (!pMonitor) {
00863 pMonitor =
GetPrimaryMonitor();
00864 }
00865
00866
if ((
dt.style & (DS_CENTER | DS_CENTERMOUSE)) && f40Compat) {
00867
00868
00869
00870 rc.left = (pMonitor->
rcWork.left + pMonitor->
rcWork.right -
dt.cx) / 2;
00871 rc.top = (pMonitor->
rcWork.top + pMonitor->
rcWork.bottom -
dt.cy) / 2;
00872 }
else {
00873 rc.left =
XPixFromXDU(
dt.x, cxChar);
00874 rc.top =
YPixFromYDU(
dt.y, cyChar);
00875
00876
if (!(
dt.style & DS_ABSALIGN) && hwndOwner) {
00877
00878
00879
00880
00881
if ((HIWORD(
dt.style) &
MaskWF(WFTYPEMASK)) !=
MaskWF(WFCHILD)) {
00882
00883
ClientToScreen(hwndOwner, (LPPOINT)&rc.left);
00884
00885
#ifdef USE_MIRRORING
00886
00887
00888
if (MIRRORED_HWND(hwndOwner)) {
00889 rc.left -=
dt.cx;
00890 }
00891
#endif
00892
00893 }
00894 }
else {
00895
00896
00897
00898
00899
00900
00901
00902
00903
PMONITOR pMonitorTemplate;
00904 RECT rcTemplate;
00905
00906 rcTemplate.left = rc.left;
00907 rcTemplate.top = rc.top;
00908 rcTemplate.right = rc.left +
dt.cx;
00909 rcTemplate.bottom = rc.top +
dt.cy;
00910
00911 pMonitorTemplate =
_MonitorFromRect(&rcTemplate, MONITOR_DEFAULTTOPRIMARY);
00912
if (fNoDialogMonitor) {
00913 pMonitor = pMonitorTemplate;
00914 }
else if (pMonitorTemplate != pMonitor) {
00915 rc.left += pMonitor->
rcMonitor.left - pMonitorTemplate->
rcMonitor.left;
00916 rc.top += pMonitor->
rcMonitor.top - pMonitorTemplate->
rcMonitor.top;
00917 }
00918 }
00919 }
00920 }
00921
00922 rc.right = rc.left +
dt.cx;
00923 rc.bottom = rc.top +
dt.cy;
00924
00925
00926
00927
00928
if (rc.left > rc.right || rc.top > rc.bottom) {
00929
OffsetRect(&rc, -
dt.cx, -
dt.cy);
00930 }
00931
00932
00933
00934
00935
00936
00937
00938
00939
RepositionRect(pMonitor, &rc,
dt.style,
dt.dwExStyle);
00940
00941
dt.x = (
SHORT)((bFlags &
CD_USEDEFAULTX) ?
CW2_USEDEFAULT : rc.left);
00942
dt.y = (
SHORT)(rc.top);
00943
dt.cx = (
SHORT)((bFlags &
CD_USEDEFAULTCX) ?
CW2_USEDEFAULT : rc.right - rc.left);
00944
dt.cy = (
SHORT)(rc.bottom - rc.top);
00945
00946
if (*lpszClass != 0) {
00947
if (
IS_PTR(lpszClass)) {
00948
RtlInitLargeUnicodeString((
PLARGE_UNICODE_STRING)&strClassName,
00949 lpszClass, (UINT)-1);
00950 pstrClassName = &strClassName;
00951 }
else {
00952 pstrClassName = (
PLARGE_STRING)lpszClass;
00953 }
00954 }
else {
00955 pstrClassName = (
PLARGE_STRING)
DIALOGCLASS;
00956 }
00957
00958
RtlInitLargeUnicodeString((
PLARGE_UNICODE_STRING)&strWindowName,
00959 lpszText, (UINT)-1);
00960
00961 UserAssert((
dt.dwExStyle & WS_EX_MDICHILD) == 0);
00962 hwnd =
NtUserCreateWindowEx(
00963
dt.dwExStyle | ((fSCDLGFlags & SCDLG_ANSI) ? WS_EX_ANSICREATOR : 0),
00964 pstrClassName,
00965 &strWindowName,
00966
dt.style,
00967
DefShortToInt(
dt.x),
00968
dt.y,
00969
DefShortToInt(
dt.cx),
00970
dt.cy,
00971 hwndOwner,
00972 hMenu,
00973 hmod,
00974 (LPVOID)NULL,
00975 dwExpWinVer);
00976
00977
if (hwnd ==
NULL) {
00978 RIPMSG0(RIP_WARNING,
"CreateDialog() failed: couldn't create window");
00979 DeleteFontAndMenuAndFail:
00980
if (hMenu !=
NULL)
00981
NtUserDestroyMenu(hMenu);
00982
00983
00984
00985
00986
if ((hNewFont !=
NULL)) {
00987 DeleteObject(hNewFont);
00988 }
00989
return NULL;
00990 }
00991
00992 pwnd =
ValidateHwnd(hwnd);
00993
00994
00995
00996
if(fSCDLGFlags & SCDLG_16BIT) {
00997
TellWOWThehDlg(hwnd);
00998 }
00999
01000
01001
01002
01003
01004
if (pwnd ==
NULL || !
ValidateDialogPwnd(pwnd))
01005
goto DeleteFontAndMenuAndFail;
01006
01007
if (
dt.dwHelpID) {
01008
NtUserSetWindowContextHelpId(hwnd,
dt.dwHelpID);
01009 }
01010
01011
01012
01013
01014
if (
TestWF(pwnd, WFSYSMENU)) {
01015
01016
01017
01018
01019
01020 UserAssert(
HIBYTE(WFSIZEBOX) ==
HIBYTE(WFMINBOX));
01021 UserAssert(
HIBYTE(WFMINBOX) ==
HIBYTE(WFMAXBOX));
01022
if (!
TestWF(pwnd, WFSIZEBOX | WFMINBOX | WFMAXBOX)) {
01023
01024
NtUserCallHwndLock(hwnd, SFI_XXXSETDIALOGSYSTEMMENU);
01025 }
else {
01026
01027
01028
01029
01030
01031
NtUserGetSystemMenu(hwnd, FALSE);
01032 }
01033 }
01034
01035
01036
01037
01038
01039
PDLG(pwnd)->fDisabled =
FALSE;
01040
01041
PDLG(pwnd)->cxChar = cxChar;
01042
PDLG(pwnd)->cyChar = cyChar;
01043
PDLG(pwnd)->lpfnDlg = lpfnDialog;
01044
PDLG(pwnd)->fEnd =
FALSE;
01045
PDLG(pwnd)->result = IDOK;
01046
01047
01048
01049
01050
if (fSCDLGFlags & SCDLG_ANSI) {
01051
PDLG(pwnd)->flags |=
DLGF_ANSI;
01052 }
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
if (LOWORD((ULONG_PTR)hmod) != 0) {
01065 fWowWindow =
TRUE;
01066 }
else {
01067 fWowWindow =
FALSE;
01068 }
01069
01070
01071
01072
01073
01074
if (bFlags &
CD_USERFONT) {
01075
01076
PDLG(pwnd)->hUserFont = hNewFont;
01077
01078
if (lpfnDialog !=
NULL) {
01079
01080
01081
01082
SendMessageWorker(pwnd, WM_SETFONT, (WPARAM)hNewFont, 0L, FALSE);
01083 }
01084 }
01085
01086
if (!
dt.wDlgVer) {
01087 dit.dwHelpID = 0;
01088 }
01089
01090
01091
01092
01093
01094
while (
dt.cDlgItems-- != 0) {
01095
DWORD dwExpWinVer2;
01096
01097
if (
dt.wDlgVer) {
01098 RtlCopyMemory(&dit, lpdit,
sizeof dit);
01099 }
else {
01100 dit.dwHelpID = 0;
01101 dit.dwExStyle = lpdit->dwExtendedStyle;
01102 dit.style = lpdit->style;
01103 dit.x = lpdit->x;
01104 dit.y = lpdit->y;
01105 dit.cx = lpdit->cx;
01106 dit.cy = lpdit->cy;
01107 dit.dwID = lpdit->id;
01108 }
01109
01110 dit.x =
XPixFromXDU(dit.x, cxChar);
01111 dit.y =
YPixFromYDU(dit.y, cyChar);
01112 dit.cx =
XPixFromXDU(dit.cx, cxChar);
01113 dit.cy =
YPixFromYDU(dit.cy, cyChar);
01114
01115 lpszClass = (LPWSTR)(((
PBYTE)(lpdit)) + (
dt.wDlgVer ?
sizeof(DLGITEMTEMPLATE2):
sizeof(DLGITEMTEMPLATE)));
01116
01117
01118
01119
01120
01121
if (*(LPWORD)lpszClass == 0xFFFF) {
01122 lpszText = lpszClass + 2;
01123 lpszClass = (LPWSTR)(
gpsi->
atomSysClass[*(((LPWORD)lpszClass)+1) & ~
CODEBIT]);
01124 }
else {
01125 lpszText = (
UTCHAR *)
SkipSz(lpszClass);
01126 }
01127 lpszText = (
UTCHAR *)
NextWordBoundary(lpszText);
01128
01129 dit.dwExStyle |= WS_EX_NOPARENTNOTIFY;
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
if (
TestWF(pwnd, DF3DLOOK)) {
01148
if ( (dit.style & WS_BORDER) ||
01149 (lpszClass == MAKEINTRESOURCE(
gpsi->
atomSysClass[ICLS_COMBOBOX]))) {
01150
01151 dit.style &= ~WS_BORDER;
01152 dit.dwExStyle |= WS_EX_CLIENTEDGE;
01153 }
01154 }
01155
01156
01157
01158
01159
01160
01161
if (*(LPWORD)lpszText == 0xFFFF) {
01162 lpCreateParams = (LPWSTR)((
PBYTE)lpszText + 4);
01163 strWindowName.
Buffer = lpszText;
01164 strWindowName.
Length = 4;
01165 strWindowName.
MaximumLength = 4;
01166 strWindowName.
bAnsi =
FALSE;
01167 }
else {
01168 lpCreateParams = (LPWSTR)((
PBYTE)
WordSkipSz(lpszText));
01169
RtlInitLargeUnicodeString((
PLARGE_UNICODE_STRING)&strWindowName,
01170 lpszText, (UINT)-1);
01171 }
01172
01173
01174
01175
01176
01177
01178
if (fWowWindow && (bFlags &
CD_GLOBALEDIT) &&
01179 ((!
IS_PTR(lpszClass) &&
01180
PTR_TO_ID(lpszClass) == (ATOM)(
gpsi->
atomSysClass[
ICLS_EDIT])) ||
01181 (
IS_PTR(lpszClass) &&
01182 (wcscmp(lpszClass, szEDITCLASS) == 0)))) {
01183
01184
01185
01186
01187
if (!(
PDLG(pwnd)->hData)) {
01188
PDLG(pwnd)->hData =
GetEditDS();
01189
if (!(
PDLG(pwnd)->hData))
01190
goto NoCreate;
01191 }
01192
01193 hmodCreate =
PDLG(pwnd)->hData;
01194 dwExpWinVer2 =
GETEXPWINVER(hmodCreate);
01195 }
else {
01196 hmodCreate = hmod;
01197 dwExpWinVer2 = dwExpWinVer;
01198 }
01199
01200
#if DBG
01201
if ((dit.dwExStyle &
WS_EX_ANSICREATOR) != 0) {
01202 RIPMSG1(RIP_WARNING,
"Bad WS_EX_ style 0x%x for a control in the dialog",
01203 dit.dwExStyle);
01204 }
01205
#endif // DBG
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
if (*lpCreateParams) {
01218 lpCreateParamsData = (LPBYTE)lpCreateParams;
01219
if (fWowWindow || fSCDLGFlags & SCDLG_16BIT) {
01220 lpCreateParamsData =
01221 (LPBYTE)ULongToPtr( *(UNALIGNED DWORD *)
01222 (lpCreateParamsData +
sizeof(WORD)) );
01223 }
01224 }
else {
01225 lpCreateParamsData =
NULL;
01226 }
01227
01228
01229
01230
01231
01232
01233
01234
if (dit.dwID) {
01235
01236
01237
01238 dit.style |= WS_CHILD;
01239 dit.style &= ~WS_POPUP;
01240 }
01241
01242
if (
IS_PTR(lpszClass)) {
01243
RtlInitLargeUnicodeString((
PLARGE_UNICODE_STRING)&strClassName,
01244 lpszClass, (UINT)-1);
01245 pstrClassName = &strClassName;
01246 }
else {
01247 pstrClassName = (
PLARGE_STRING)lpszClass;
01248 }
01249 UserAssert((dit.dwExStyle & WS_EX_MDICHILD) == 0);
01250
01251 hwnd2 =
NtUserCreateWindowEx(
01252 dit.dwExStyle | ((fSCDLGFlags & SCDLG_ANSI) ? WS_EX_ANSICREATOR : 0),
01253 pstrClassName,
01254 &strWindowName,
01255 dit.style,
01256
DefShortToInt(dit.x),
01257 dit.y,
01258
DefShortToInt(dit.cx),
01259 dit.cy,
01260 hwnd,
01261 (HMENU)LongToHandle( dit.dwID ),
01262 hmodCreate,
01263 lpCreateParamsData,
01264 dwExpWinVer2);
01265
01266
if (hwnd2 ==
NULL) {
01267 NoCreate:
01268
01269
01270
01271
if (!
TestWF(pwnd, DFNOFAILCREATE)) {
01272 RIPMSG0(RIP_WARNING,
"CreateDialog() failed: couldn't create control");
01273
NtUserDestroyWindow(hwnd);
01274
return NULL;
01275 }
01276 }
else {
01277
01278
if (dit.dwHelpID) {
01279
NtUserSetWindowContextHelpId(hwnd2, dit.dwHelpID);
01280 }
01281
01282
01283
01284
01285
01286
if (hNewFont !=
NULL) {
01287
SendMessage(hwnd2, WM_SETFONT, (WPARAM)hNewFont, 0L);
01288 }
01289
01290
01291
01292
01293
if (
SendMessage(hwnd2, WM_GETDLGCODE, 0, 0L) & DLGC_DEFPUSHBUTTON) {
01294
PDLG(pwnd)->result = dit.dwID;
01295 }
01296
01297 }
01298
01299
01300
01301 lpdit = (LPDLGITEMTEMPLATE)
NextDWordBoundary(
01302 (LPBYTE)(lpCreateParams + 1) + *lpCreateParams);
01303 }
01304
01305
if (!
TestWF(pwnd, DFCONTROL)) {
01306
PWND pwndT =
_GetNextDlgTabItem(pwnd, NULL, FALSE);
01307 hwndEditFirst =
HW(pwndT);
01308 }
01309
01310
if (lpfnDialog !=
NULL) {
01311 fSuccess = (
BOOL)
SendMessageWorker(pwnd, WM_INITDIALOG,
01312 (WPARAM)hwndEditFirst, lParam, FALSE);
01313
01314
01315
01316
01317
if (!
RevalidateHwnd(hwnd)) {
01318
goto CreateDialogReturn;
01319 }
01320
if (fSuccess && !
PDLG(pwnd)->fEnd) {
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
if (!
TestWF(pwnd, DFCONTROL)) {
01331
PWND pwndT;
01332
if (!
IsWindow(hwndEditFirst) ||
TestWF(pwnd, WFWIN40COMPAT))
01333 hwndEditFirst =
NULL;
01334
01335
01336
01337
01338
01339 pwndT =
_GetNextDlgTabItem(pwnd, NULL, FALSE);
01340
if (hwndNewFocus =
HW(pwndT)) {
01341
DlgSetFocus(hwndNewFocus);
01342 }
01343
01344
xxxCheckDefPushButton(pwnd, hwndEditFirst, hwndNewFocus);
01345 }
01346 }
01347 }
01348
01349
if (!
IsWindow(hwnd))
01350 {
01351
01352
01353
01354
if (
GETAPPVER() <
VER40) {
01355
return(hwnd);
01356 }
01357
01358
return(
NULL);
01359 }
01360
01361
01362
01363
01364
01365
if (
TEST_KbdCuesPUSIF) {
01366
01367
01368
01369
01370
01371
if (!
TestwndChild(pwnd)) {
01372
SendMessageWorker(pwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0, FALSE);
01373 }
01374 }
01375
01376
01377
01378
01379
01380
if (bFlags &
CD_SETFOREGROUND) {
01381
NtUserSetForegroundWindow(hwnd);
01382
if (!
IsWindow(hwnd)) {
01383 hwnd =
NULL;
01384
goto CreateDialogReturn;
01385 }
01386 }
01387
01388
if ((bFlags &
CD_VISIBLE) && !
PDLG(pwnd)->fEnd && (!
TestWF(pwnd, WFVISIBLE))) {
01389
NtUserShowWindow(hwnd, SHOW_OPENWINDOW);
01390
UpdateWindow(hwnd);
01391 }
01392
01393 CreateDialogReturn:
01394
01395
01396
01397
01398
01399
01400
if (!(fSCDLGFlags & SCDLG_NOREVALIDATE) && !
RevalidateHwnd(hwnd)) {
01401 hwnd =
NULL;
01402 }
01403
01404
return hwnd;
01405 }