ReactOS  0.4.13-dev-482-ge57f103
dialog.c File Reference
#include <user32.h>
Include dependency graph for dialog.c:

Go to the source code of this file.

Classes

struct  DIALOGINFO
 
struct  DLG_CONTROL_INFO
 
struct  DLG_TEMPLATE
 
struct  RADIOGROUP
 

Macros

#define DF_END   0x0001
 
#define DF_DIALOGACTIVE   0x4000
 
#define DWLP_ROS_DIALOGINFO   (DWLP_USER+sizeof(ULONG_PTR))
 
#define GETDLGINFO(hwnd)   DIALOG_get_info(hwnd, FALSE)
 
#define SETDLGINFO(hwnd, info)   SetWindowLongPtrW((hwnd), DWLP_ROS_DIALOGINFO, (LONG_PTR)(info))
 
#define GET_WORD(ptr)   (*(WORD *)(ptr))
 
#define GET_DWORD(ptr)   (*(DWORD *)(ptr))
 
#define DLG_ISANSI   2
 
#define SENDMSG(msg, wparam, lparam)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
DIALOGINFODIALOG_get_info (HWND hWnd, BOOL create)
 
static const WORDDIALOG_GetControl32 (const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx)
 
static BOOL DIALOG_CreateControls32 (HWND hwnd, LPCSTR template, const DLG_TEMPLATE *dlgTemplate, HINSTANCE hInst, BOOL unicode)
 
static BOOL DIALOG_IsAccelerator (HWND hwnd, HWND hwndDlg, WPARAM wParam)
 
static HWND DIALOG_FindMsgDestination (HWND hwndDlg)
 
INT DIALOG_DoDialogBox (HWND hwnd, HWND owner)
 
static LPCSTR DIALOG_ParseTemplate32 (LPCSTR template, DLG_TEMPLATE *result)
 
static void DEFDLG_SetFocus (HWND hwndCtrl)
 
static void DEFDLG_SaveFocus (HWND hwnd)
 
static void DEFDLG_RestoreFocus (HWND hwnd, BOOL justActivate)
 
static HWND DIALOG_CreateIndirect (HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
 
static HWND DEFDLG_FindDefButton (HWND hwndDlg)
 
static BOOL DEFDLG_SetDefId (HWND hwndDlg, DIALOGINFO *dlgInfo, WPARAM wParam)
 
static BOOL DEFDLG_SetDefButton (HWND hwndDlg, DIALOGINFO *dlgInfo, HWND hwndNew)
 
static LRESULT DEFDLG_Proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, DIALOGINFO *dlgInfo)
 
static LRESULT DEFDLG_Epilog (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fResult, BOOL fAnsi)
 
static HWND DIALOG_GetNextTabItem (HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious)
 
static INT DIALOG_DlgDirListW (HWND hDlg, LPWSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
 
static INT DIALOG_DlgDirListA (HWND hDlg, LPSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
 
static BOOL DIALOG_DlgDirSelect (HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
 
HWND WINAPI CreateDialogIndirectParamAorW (HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD Flags)
 
HWND WINAPI CreateDialogIndirectParamA (HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
 
HWND WINAPI CreateDialogIndirectParamW (HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
 
HWND WINAPI CreateDialogParamA (HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
HWND WINAPI CreateDialogParamW (HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
LRESULT WINAPI DefDlgProcA (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DefDlgProcW (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 
INT_PTR WINAPI DialogBoxIndirectParamAorW (HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam, DWORD Flags)
 
INT_PTR WINAPI DialogBoxIndirectParamA (HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
INT_PTR WINAPI DialogBoxIndirectParamW (HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
INT_PTR WINAPI DialogBoxParamA (HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
INT_PTR WINAPI DialogBoxParamW (HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 
int WINAPI DlgDirListA (HWND hDlg, LPSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType)
 
int WINAPI DlgDirListComboBoxA (HWND hDlg, LPSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype)
 
int WINAPI DlgDirListComboBoxW (HWND hDlg, LPWSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype)
 
int WINAPI DlgDirListW (HWND hDlg, LPWSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType)
 
BOOL WINAPI DlgDirSelectComboBoxExA (HWND hDlg, LPSTR lpString, int nCount, int nIDComboBox)
 
BOOL WINAPI DlgDirSelectComboBoxExW (HWND hDlg, LPWSTR lpString, int nCount, int nIDComboBox)
 
BOOL WINAPI DlgDirSelectExA (HWND hDlg, LPSTR lpString, int nCount, int nIDListBox)
 
BOOL WINAPI DlgDirSelectExW (HWND hDlg, LPWSTR lpString, int nCount, int nIDListBox)
 
BOOL WINAPI EndDialog (HWND hwnd, INT_PTR retval)
 
LONG WINAPI GetDialogBaseUnits (VOID)
 
int WINAPI GetDlgCtrlID (HWND hwndCtl)
 
HWND WINAPI GetDlgItem (HWND hDlg, int nIDDlgItem)
 
UINT WINAPI GetDlgItemInt (HWND hDlg, int nIDDlgItem, BOOL *lpTranslated, BOOL bSigned)
 
UINT WINAPI GetDlgItemTextA (HWND hDlg, int nIDDlgItem, LPSTR lpString, int nMaxCount)
 
UINT WINAPI GetDlgItemTextW (HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
 
HWND WINAPI GetNextDlgGroupItem (HWND hDlg, HWND hCtl, BOOL bPrevious)
 
HWND WINAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious)
 
static BOOL CALLBACK DIALOG_FixOneChildOnChangeFocus (HWND hwndChild, LPARAM lParam)
 
static void DIALOG_FixChildrenOnChangeFocus (HWND hwndDlg, HWND hwndNext)
 
static HWND DIALOG_IdToHwnd (HWND hwndDlg, INT id)
 
BOOL WINAPI IsDialogMessageW (HWND hDlg, LPMSG lpMsg)
 
UINT WINAPI IsDlgButtonChecked (HWND hDlg, int nIDButton)
 
BOOL WINAPI MapDialogRect (HWND hDlg, LPRECT lpRect)
 
LRESULT WINAPI SendDlgItemMessageA (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SendDlgItemMessageW (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI SetDlgItemInt (HWND hDlg, int nIDDlgItem, UINT uValue, BOOL bSigned)
 
BOOL WINAPI SetDlgItemTextA (HWND hDlg, int nIDDlgItem, LPCSTR lpString)
 
BOOL WINAPI SetDlgItemTextW (HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
 
BOOL WINAPI CheckDlgButton (HWND hDlg, int nIDButton, UINT uCheck)
 
static BOOL CALLBACK CheckRB (HWND hwnd, LPARAM lParam)
 
BOOL WINAPI CheckRadioButton (HWND hDlg, int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 

Variables

const struct builtin_class_descr DIALOG_builtin_class
 

Macro Definition Documentation

◆ DF_DIALOGACTIVE

#define DF_DIALOGACTIVE   0x4000

Definition at line 38 of file dialog.c.

◆ DF_END

#define DF_END   0x0001

Definition at line 37 of file dialog.c.

◆ DLG_ISANSI

#define DLG_ISANSI   2

Definition at line 44 of file dialog.c.

◆ DWLP_ROS_DIALOGINFO

#define DWLP_ROS_DIALOGINFO   (DWLP_USER+sizeof(ULONG_PTR))

Definition at line 39 of file dialog.c.

◆ GET_DWORD

#define GET_DWORD (   ptr)    (*(DWORD *)(ptr))

Definition at line 43 of file dialog.c.

◆ GET_WORD

#define GET_WORD (   ptr)    (*(WORD *)(ptr))

Definition at line 42 of file dialog.c.

◆ GETDLGINFO

#define GETDLGINFO (   hwnd)    DIALOG_get_info(hwnd, FALSE)

Definition at line 40 of file dialog.c.

◆ SENDMSG

#define SENDMSG (   msg,
  wparam,
  lparam 
)
Value:
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define DDL_POSTMSGS
Definition: winuser.h:424
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM wparam
Definition: combo.c:716

◆ SETDLGINFO

#define SETDLGINFO (   hwnd,
  info 
)    SetWindowLongPtrW((hwnd), DWLP_ROS_DIALOGINFO, (LONG_PTR)(info))

Definition at line 41 of file dialog.c.

Function Documentation

◆ CheckDlgButton()

BOOL WINAPI CheckDlgButton ( HWND  hDlg,
int  nIDButton,
UINT  uCheck 
)

Definition at line 2772 of file dialog.c.

2776 {
2777  SendDlgItemMessageW( hDlg, nIDButton, BM_SETCHECK, uCheck, 0 );
2778  return TRUE;
2779 }
#define TRUE
Definition: types.h:120
#define BM_SETCHECK
Definition: winuser.h:1882
LRESULT WINAPI SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2700

Referenced by DIALOG_EXECUTE_DlgProc(), and DIALOG_PROGRAM_DlgProc().

◆ CheckRadioButton()

BOOL WINAPI CheckRadioButton ( HWND  hDlg,
int  nIDFirstButton,
int  nIDLastButton,
int  nIDCheckButton 
)

Definition at line 2807 of file dialog.c.

2812 {
2813  RADIOGROUP radioGroup;
2814 
2815  radioGroup.firstID = nIDFirstButton;
2816  radioGroup.lastID = nIDLastButton;
2817  radioGroup.checkID = nIDCheckButton;
2818 
2819  return EnumChildWindows(hDlg, CheckRB, (LPARAM)&radioGroup);
2820 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
UINT lastID
Definition: dialog.c:102
LONG_PTR LPARAM
Definition: windef.h:208
UINT firstID
Definition: dialog.c:101
UINT checkID
Definition: dialog.c:103
static BOOL CALLBACK CheckRB(HWND hwnd, LPARAM lParam)
Definition: dialog.c:2781

Referenced by DIALOG_NEW_DlgProc().

◆ CheckRB()

static BOOL CALLBACK CheckRB ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 2781 of file dialog.c.

2782 {
2783  LONG lChildID = GetWindowLongPtrW(hwnd, GWLP_ID);
2784  RADIOGROUP *lpRadioGroup = (RADIOGROUP *)lParam;
2785 
2786  if((lChildID >= lpRadioGroup->firstID) &&
2787  (lChildID <= lpRadioGroup->lastID))
2788  {
2789  if (lChildID == lpRadioGroup->checkID)
2790  {
2792  }
2793  else
2794  {
2796  }
2797  }
2798 
2799  return TRUE;
2800 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
UINT lastID
Definition: dialog.c:102
#define GetWindowLongPtrW
Definition: winuser.h:4698
long LONG
Definition: pedump.c:60
#define BM_SETCHECK
Definition: winuser.h:1882
#define BST_UNCHECKED
Definition: winuser.h:199
UINT firstID
Definition: dialog.c:101
UINT checkID
Definition: dialog.c:103
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
LPARAM lParam
Definition: combotst.c:139
#define GWLP_ID
Definition: winuser.h:854

Referenced by CheckRadioButton().

◆ CreateDialogIndirectParamA()

HWND WINAPI CreateDialogIndirectParamA ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit 
)

Definition at line 1575 of file dialog.c.

1581 {
1582  return CreateDialogIndirectParamAorW( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit, DLG_ISANSI);
1583 }
#define DLG_ISANSI
Definition: dialog.c:44
HINSTANCE hInstance
Definition: charmap.c:20
HWND WINAPI CreateDialogIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD Flags)
Definition: dialog.c:1553

Referenced by CreateDialogParamA(), test_focus(), and test_SaveRestoreFocus().

◆ CreateDialogIndirectParamAorW()

HWND WINAPI CreateDialogIndirectParamAorW ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  Flags 
)

Definition at line 1553 of file dialog.c.

1560 {
1561 /* FIXME:
1562  * This function might be obsolete since I don't think it is exported by NT
1563  * Also wine has one more parameter identifying weather it should call
1564  * the function with unicode or not
1565  */
1566  return DIALOG_CreateIndirect( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit , Flags == DLG_ISANSI ? FALSE : TRUE, NULL );
1567 }
#define TRUE
Definition: types.h:120
#define DLG_ISANSI
Definition: dialog.c:44
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:773

Referenced by CreateDialogIndirectParamA(), and CreateDialogIndirectParamW().

◆ CreateDialogIndirectParamW()

HWND WINAPI CreateDialogIndirectParamW ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit 
)

Definition at line 1591 of file dialog.c.

1597 {
1598  return CreateDialogIndirectParamAorW( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit, 0);
1599 }
HINSTANCE hInstance
Definition: charmap.c:20
HWND WINAPI CreateDialogIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD Flags)
Definition: dialog.c:1553

Referenced by CreateDialogParamW(), and test_MessageBoxFontTest().

◆ CreateDialogParamA()

HWND WINAPI CreateDialogParamA ( HINSTANCE  hInstance,
LPCSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1607 of file dialog.c.

1613 {
1614  HRSRC hrsrc;
1616 
1617  if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG ))) return 0;
1618  if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
1619  return CreateDialogIndirectParamA( hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam );
1620 }
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
HWND WINAPI CreateDialogIndirectParamA(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
Definition: dialog.c:1575
HINSTANCE hInstance
Definition: charmap.c:20
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const char * LPCSTR
Definition: xmlstorage.h:183
#define RT_DIALOG
Definition: pedump.c:367

◆ CreateDialogParamW()

HWND WINAPI CreateDialogParamW ( HINSTANCE  hInstance,
LPCWSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1628 of file dialog.c.

1634 {
1635  HRSRC hrsrc;
1637 
1638  if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG ))) return 0;
1639  if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
1640  return CreateDialogIndirectParamW( hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam );
1641 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HWND WINAPI CreateDialogIndirectParamW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
Definition: dialog.c:1591
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HINSTANCE hInstance
Definition: charmap.c:20
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define RT_DIALOG
Definition: pedump.c:367

◆ DEFDLG_Epilog()

static LRESULT DEFDLG_Epilog ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  fResult,
BOOL  fAnsi 
)
static

Definition at line 1289 of file dialog.c.

1290 {
1291  if ((msg >= WM_CTLCOLORMSGBOX && msg <= WM_CTLCOLORSTATIC) ||
1292  msg == WM_CTLCOLOR)
1293  {
1294  if (fResult) return fResult;
1295 
1296  return fAnsi ? DefWindowProcA(hwnd, msg, wParam, lParam):
1298  }
1299  if ( msg == WM_COMPAREITEM ||
1300  msg == WM_VKEYTOITEM || msg == WM_CHARTOITEM ||
1302  return fResult;
1303 
1305 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define GetWindowLongPtrW
Definition: winuser.h:4698
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_QUERYDRAGICON
Definition: winuser.h:1636
#define WM_CHARTOITEM
Definition: winuser.h:1631
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1742
#define WM_VKEYTOITEM
Definition: winuser.h:1630
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_COMPAREITEM
Definition: winuser.h:1637
#define msg(x)
Definition: auth_time.c:54
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139

Referenced by DefDlgProcA(), and DefDlgProcW().

◆ DEFDLG_FindDefButton()

static HWND DEFDLG_FindDefButton ( HWND  hwndDlg)
static

Definition at line 1082 of file dialog.c.

1083 {
1084  HWND hwndChild, hwndTmp;
1085 
1086  hwndChild = GetWindow( hwndDlg, GW_CHILD );
1087  while (hwndChild)
1088  {
1089  if (SendMessageW( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
1090  break;
1091 
1092  /* Recurse into WS_EX_CONTROLPARENT controls */
1094  {
1095  LONG dsStyle = GetWindowLongPtrW( hwndChild, GWL_STYLE );
1096  if ((dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED) &&
1097  (hwndTmp = DEFDLG_FindDefButton(hwndChild)) != NULL)
1098  return hwndTmp;
1099  }
1100  hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
1101  }
1102  return hwndChild;
1103 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define WS_DISABLED
Definition: pedump.c:621
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1082
#define GW_CHILD
Definition: winuser.h:758
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define GWL_EXSTYLE
Definition: winuser.h:845
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GWL_STYLE
Definition: winuser.h:846
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by DEFDLG_Proc(), DEFDLG_SetDefButton(), and DEFDLG_SetDefId().

◆ DEFDLG_Proc()

static LRESULT DEFDLG_Proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam,
DIALOGINFO dlgInfo 
)
static

Definition at line 1183 of file dialog.c.

1185 {
1186  switch(msg)
1187  {
1188  case WM_ERASEBKGND:
1189  {
1190  HBRUSH brush = GetControlColor( hwnd, hwnd, (HDC)wParam, WM_CTLCOLORDLG);
1191  if (brush)
1192  {
1193  RECT rect;
1194  HDC hdc = (HDC)wParam;
1195  GetClientRect( hwnd, &rect );
1196  DPtoLP( hdc, (LPPOINT)&rect, 2 );
1197  FillRect( hdc, &rect, brush );
1198  }
1199  return 1;
1200  }
1201  case WM_NCDESTROY:
1203  if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 )))
1204  {
1205  if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
1206  if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
1207  HeapFree( GetProcessHeap(), 0, dlgInfo );
1210  }
1211  /* Window clean-up */
1212  return DefWindowProcA( hwnd, msg, wParam, lParam );
1213 
1214  case WM_SHOWWINDOW:
1215  if (!wParam) DEFDLG_SaveFocus( hwnd );
1216  return DefWindowProcA( hwnd, msg, wParam, lParam );
1217 
1218  case WM_ACTIVATE:
1219  { // ReactOS
1220  DWORD dwSetFlag;
1222  // if WA_CLICK/ACTIVE ? set dialog is active.
1223  dwSetFlag = wParam ? DF_DIALOGACTIVE : 0;
1225  }
1227  else DEFDLG_SaveFocus( hwnd );
1228  return 0;
1229 
1230  case WM_SETFOCUS:
1232  return 0;
1233 
1234  case DM_SETDEFID:
1235  if (dlgInfo && !(dlgInfo->flags & DF_END))
1236  DEFDLG_SetDefId( hwnd, dlgInfo, wParam );
1237  return 1;
1238 
1239  case DM_GETDEFID:
1240  if (dlgInfo && !(dlgInfo->flags & DF_END))
1241  {
1242  HWND hwndDefId;
1243  if (dlgInfo->idResult)
1244  return MAKELONG( dlgInfo->idResult, DC_HASDEFID );
1245  if ((hwndDefId = DEFDLG_FindDefButton( hwnd )))
1246  return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID);
1247  }
1248  return 0;
1249 
1250  case WM_NEXTDLGCTL:
1251  if (dlgInfo)
1252  {
1253  HWND hwndDest = (HWND)wParam;
1254  if (!lParam)
1255  hwndDest = GetNextDlgTabItem(hwnd, GetFocus(), wParam);
1256  if (hwndDest) DEFDLG_SetFocus( hwndDest );
1257  DEFDLG_SetDefButton( hwnd, dlgInfo, hwndDest );
1258  }
1259  return 0;
1260 
1261  case WM_ENTERMENULOOP:
1262  case WM_LBUTTONDOWN:
1263  case WM_NCLBUTTONDOWN:
1264  {
1265  HWND hwndFocus = GetFocus();
1266  if (hwndFocus)
1267  {
1268  /* always make combo box hide its listbox control */
1269  if (!SendMessageW( hwndFocus, CB_SHOWDROPDOWN, FALSE, 0 ))
1270  SendMessageW( GetParent(hwndFocus), CB_SHOWDROPDOWN, FALSE, 0 );
1271  }
1272  }
1273  return DefWindowProcA( hwnd, msg, wParam, lParam );
1274 
1275  case WM_GETFONT:
1276  return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
1277 
1278  case WM_CLOSE:
1280  (LPARAM)GetDlgItem( hwnd, IDCANCEL ) );
1281  return 0;
1282  }
1283  return 0;
1284 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND WINAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2330
static HWND hwndparent
Definition: listview.c:56
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1082
static void DEFDLG_SetFocus(HWND hwndCtrl)
Definition: dialog.c:713
static void DEFDLG_RestoreFocus(HWND hwnd, BOOL justActivate)
Definition: dialog.c:739
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CTLCOLORDLG
Definition: winuser.h:1746
static BOOL DEFDLG_SetDefButton(HWND hwndDlg, DIALOGINFO *dlgInfo, HWND hwndNew)
Definition: dialog.c:1144
static HDC
Definition: imagelist.c:92
static BOOL DEFDLG_SetDefId(HWND hwndDlg, DIALOGINFO *dlgInfo, WPARAM wParam)
Definition: dialog.c:1111
EXTINLINE VOID NtUserxSetDialogPointer(HWND hWnd, PVOID dlgInfo)
Definition: ntwrapper.h:716
HANDLE HWND
Definition: compat.h:13
#define WM_SHOWWINDOW
Definition: winuser.h:1610
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define DM_SETDEFID
Definition: winuser.h:2060
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define DM_GETDEFID
Definition: winuser.h:2059
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:145
HFONT hUserFont
Definition: dialog.c:52
#define CB_SHOWDROPDOWN
Definition: winuser.h:1931
#define DC_HASDEFID
Definition: winuser.h:2563
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define WM_GETFONT
Definition: winuser.h:1633
LONG_PTR LPARAM
Definition: windef.h:208
#define DWLP_ROS_DIALOGINFO
Definition: dialog.c:39
#define GetProcessHeap()
Definition: compat.h:395
INT idResult
Definition: dialog.c:56
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
#define BN_CLICKED
Definition: winuser.h:1886
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD NTAPI NtUserSetThreadState(DWORD Unknown0, DWORD Unknown1)
Definition: misc.c:328
HDC hdc
Definition: main.c:9
static HWND DIALOG_FindMsgDestination(HWND hwndDlg)
Definition: dialog.c:475
#define LRESULT
Definition: ole.h:14
#define WM_COMMAND
Definition: winuser.h:1716
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT flags
Definition: dialog.c:57
BOOL WINAPI DestroyMenu(_In_ HMENU)
int WINAPI GetDlgCtrlID(HWND hwndCtl)
Definition: dialog.c:2101
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define WM_ACTIVATE
Definition: winuser.h:1594
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU hMenu
Definition: dialog.c:53
HWND WINAPI GetFocus(void)
Definition: window.c:1875
#define msg(x)
Definition: auth_time.c:54
#define DF_END
Definition: dialog.c:37
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
#define DF_DIALOGACTIVE
Definition: dialog.c:38
#define IDCANCEL
Definition: winuser.h:825
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
static void DEFDLG_SaveFocus(HWND hwnd)
Definition: dialog.c:724

Referenced by DefDlgProcA(), and DefDlgProcW().

◆ DEFDLG_RestoreFocus()

static void DEFDLG_RestoreFocus ( HWND  hwnd,
BOOL  justActivate 
)
static

Definition at line 739 of file dialog.c.

740 {
741  DIALOGINFO *infoPtr;
742 
743  if (IsIconic( hwnd )) return;
744  if (!(infoPtr = GETDLGINFO(hwnd))) return;
745  /* Don't set the focus back to controls if EndDialog is already called.*/
746  if (infoPtr->flags & DF_END) return;
747  if (!IsWindow(infoPtr->hwndFocus) || infoPtr->hwndFocus == hwnd) {
748  if (justActivate) return;
749  /* If no saved focus control exists, set focus to the first visible,
750  non-disabled, WS_TABSTOP control in the dialog */
751  infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
752  /* If there are no WS_TABSTOP controls, set focus to the first visible,
753  non-disabled control in the dialog */
754  if (!infoPtr->hwndFocus) infoPtr->hwndFocus = GetNextDlgGroupItem( hwnd, 0, FALSE );
755  if (!IsWindow( infoPtr->hwndFocus )) return;
756  }
757  if (justActivate)
758  SetFocus( infoPtr->hwndFocus );
759  else
760  DEFDLG_SetFocus( infoPtr->hwndFocus );
761 
762  infoPtr->hwndFocus = NULL;
763 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND WINAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2330
static void DEFDLG_SetFocus(HWND hwndCtrl)
Definition: dialog.c:713
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI IsIconic(_In_ HWND)
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
HWND WINAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2212
smooth NULL
Definition: ftsmooth.c:416
UINT flags
Definition: dialog.c:57
HWND hwndFocus
Definition: dialog.c:51
#define DF_END
Definition: dialog.c:37

Referenced by DEFDLG_Proc().

◆ DEFDLG_SaveFocus()

static void DEFDLG_SaveFocus ( HWND  hwnd)
static

Definition at line 724 of file dialog.c.

725 {
726  DIALOGINFO *infoPtr;
727  HWND hwndFocus = GetFocus();
728 
729  if (!hwndFocus || !IsChild( hwnd, hwndFocus )) return;
730  if (!(infoPtr = GETDLGINFO(hwnd))) return;
731  infoPtr->hwndFocus = hwndFocus;
732  /* Remove default button */
733 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
HWND hwndFocus
Definition: dialog.c:51
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
HWND WINAPI GetFocus(void)
Definition: window.c:1875

Referenced by DEFDLG_Proc().

◆ DEFDLG_SetDefButton()

static BOOL DEFDLG_SetDefButton ( HWND  hwndDlg,
DIALOGINFO dlgInfo,
HWND  hwndNew 
)
static

Need to draw only default push button rectangle. Since the next control is not a push button, need to draw the push button rectangle for the default control.

Definition at line 1144 of file dialog.c.

1145 {
1146  DWORD dlgcode=0; /* initialize just to avoid a warning */
1147  HWND hwndOld = GetDlgItem( hwndDlg, dlgInfo->idResult );
1148 
1149  if (hwndNew &&
1150  !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ))
1152  {
1158  hwndNew = hwndOld;
1159  dlgcode = SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 );
1160  }
1161 
1162  /* Make sure the old default control is a valid push button ID */
1163  if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
1164  hwndOld = DEFDLG_FindDefButton( hwndDlg );
1165  if (hwndOld && hwndOld != hwndNew)
1167 
1168  if (hwndNew)
1169  {
1170  if(dlgcode & DLGC_UNDEFPUSHBUTTON)
1172  }
1173  return TRUE;
1174 }
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2570
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1082
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define BM_SETSTYLE
Definition: winuser.h:1885
INT idResult
Definition: dialog.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BS_PUSHBUTTON
Definition: pedump.c:651
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113

Referenced by DEFDLG_Proc().

◆ DEFDLG_SetDefId()

static BOOL DEFDLG_SetDefId ( HWND  hwndDlg,
DIALOGINFO dlgInfo,
WPARAM  wParam 
)
static

Definition at line 1111 of file dialog.c.

1112 {
1113  DWORD dlgcode=0; /* initialize just to avoid a warning */
1114  HWND hwndOld, hwndNew = GetDlgItem(hwndDlg, wParam);
1115  INT old_id = dlgInfo->idResult;
1116 
1117  dlgInfo->idResult = wParam;
1118  if (hwndNew &&
1119  !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ))
1121  return FALSE; /* Destination is not a push button */
1122 
1123  /* Make sure the old default control is a valid push button ID */
1124  hwndOld = GetDlgItem( hwndDlg, old_id );
1125  if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
1126  hwndOld = DEFDLG_FindDefButton( hwndDlg );
1127  if (hwndOld && hwndOld != hwndNew)
1129 
1130  if (hwndNew)
1131  {
1132  if(dlgcode & DLGC_UNDEFPUSHBUTTON)
1134  }
1135  return TRUE;
1136 }
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2570
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1082
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define BM_SETSTYLE
Definition: winuser.h:1885
INT idResult
Definition: dialog.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define DLGC_BUTTON
Definition: winuser.h:2574
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113

Referenced by DEFDLG_Proc().

◆ DEFDLG_SetFocus()

static void DEFDLG_SetFocus ( HWND  hwndCtrl)
static

Definition at line 713 of file dialog.c.

714 {
715  if (SendMessageW( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
716  SendMessageW( hwndCtrl, EM_SETSEL, 0, -1 );
717  SetFocus( hwndCtrl );
718 }
#define WM_GETDLGCODE
Definition: winuser.h:1671
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLGC_HASSETSEL
Definition: winuser.h:2568
#define EM_SETSEL
Definition: winuser.h:1979
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by DEFDLG_Proc(), and DEFDLG_RestoreFocus().

◆ DefDlgProcA()

LRESULT WINAPI DefDlgProcA ( HWND  hDlg,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1649 of file dialog.c.

1654 {
1655  DIALOGINFO *dlgInfo;
1656  WNDPROC dlgproc;
1657  BOOL result = FALSE;
1658 
1659  /* Perform DIALOGINFO initialization if not done */
1660  if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
1661 
1662  SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
1663 
1664  if ((dlgproc = (WNDPROC)GetWindowLongPtrW( hDlg, DWLP_DLGPROC )))
1665  {
1666  /* Call dialog procedure */
1667  result = CallWindowProcA( dlgproc, hDlg, Msg, wParam, lParam );
1668  }
1669 
1670  if (!result && IsWindow(hDlg))
1671  {
1672  /* callback didn't process this message */
1673 
1674  switch(Msg)
1675  {
1676  case WM_ERASEBKGND:
1677  case WM_SHOWWINDOW:
1678  case WM_ACTIVATE:
1679  case WM_SETFOCUS:
1680  case DM_SETDEFID:
1681  case DM_GETDEFID:
1682  case WM_NEXTDLGCTL:
1683  case WM_GETFONT:
1684  case WM_CLOSE:
1685  case WM_NCDESTROY:
1686  case WM_ENTERMENULOOP:
1687  case WM_LBUTTONDOWN:
1688  case WM_NCLBUTTONDOWN:
1689  return DEFDLG_Proc( hDlg, Msg, wParam, lParam, dlgInfo );
1690  case WM_INITDIALOG:
1691  case WM_VKEYTOITEM:
1692  case WM_COMPAREITEM:
1693  case WM_CHARTOITEM:
1694  break;
1695 
1696  default:
1697  return DefWindowProcA( hDlg, Msg, wParam, lParam );
1698  }
1699  }
1700  return DEFDLG_Epilog(hDlg, Msg, wParam, lParam, result, TRUE);
1701 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define TRUE
Definition: types.h:120
#define DWLP_DLGPROC
Definition: winuser.h:865
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
BOOL WINAPI IsWindow(_In_opt_ HWND)
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:132
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define DM_SETDEFID
Definition: winuser.h:2060
#define GetWindowLongPtrW
Definition: winuser.h:4698
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_GETDEFID
Definition: winuser.h:2059
#define WM_CHARTOITEM
Definition: winuser.h:1631
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define WM_GETFONT
Definition: winuser.h:1633
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
#define WM_VKEYTOITEM
Definition: winuser.h:1630
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct @1574 Msg[]
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define WM_COMPAREITEM
Definition: winuser.h:1637
#define WM_ACTIVATE
Definition: winuser.h:1594
static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fResult, BOOL fAnsi)
Definition: dialog.c:1289
#define SetWindowLongPtrW
Definition: winuser.h:5215
static LRESULT DEFDLG_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, DIALOGINFO *dlgInfo)
Definition: dialog.c:1183
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
GLuint64EXT * result
Definition: glext.h:11304
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139

Referenced by dlg_test_aw_message(), test_DialogBoxParam(), test_WM_NEXTDLGCTL(), and testDlgWinProc().

◆ DefDlgProcW()

LRESULT WINAPI DefDlgProcW ( HWND  hDlg,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1709 of file dialog.c.

1714 {
1715  DIALOGINFO *dlgInfo;
1716  WNDPROC dlgproc;
1717  BOOL result = FALSE;
1718 
1719  /* Perform DIALOGINFO initialization if not done */
1720  if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
1721 
1722  SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
1723 
1724  if ((dlgproc = (WNDPROC)GetWindowLongPtrW( hDlg, DWLP_DLGPROC )))
1725  {
1726  /* Call dialog procedure */
1727  result = CallWindowProcW( dlgproc, hDlg, Msg, wParam, lParam );
1728  }
1729 
1730  if (!result && IsWindow(hDlg))
1731  {
1732  /* callback didn't process this message */
1733 
1734  switch(Msg)
1735  {
1736  case WM_ERASEBKGND:
1737  case WM_SHOWWINDOW:
1738  case WM_ACTIVATE:
1739  case WM_SETFOCUS:
1740  case DM_SETDEFID:
1741  case DM_GETDEFID:
1742  case WM_NEXTDLGCTL:
1743  case WM_GETFONT:
1744  case WM_CLOSE:
1745  case WM_NCDESTROY:
1746  case WM_ENTERMENULOOP:
1747  case WM_LBUTTONDOWN:
1748  case WM_NCLBUTTONDOWN:
1749  return DEFDLG_Proc( hDlg, Msg, wParam, lParam, dlgInfo );
1750  case WM_INITDIALOG:
1751  case WM_VKEYTOITEM:
1752  case WM_COMPAREITEM:
1753  case WM_CHARTOITEM:
1754  break;
1755 
1756  default:
1757  return DefWindowProcW( hDlg, Msg, wParam, lParam );
1758  }
1759  }
1760  return DEFDLG_Epilog(hDlg, Msg, wParam, lParam, result, FALSE);
1761 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
#define TRUE
Definition: types.h:120
#define DWLP_DLGPROC
Definition: winuser.h:865
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
BOOL WINAPI IsWindow(_In_opt_ HWND)
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:132
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define DM_SETDEFID
Definition: winuser.h:2060
#define GetWindowLongPtrW
Definition: winuser.h:4698
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_GETDEFID
Definition: winuser.h:2059
#define WM_CHARTOITEM
Definition: winuser.h:1631
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define WM_GETFONT
Definition: winuser.h:1633
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
#define WM_VKEYTOITEM
Definition: winuser.h:1630
struct @1574 Msg[]
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define WM_COMPAREITEM
Definition: winuser.h:1637
#define WM_ACTIVATE
Definition: winuser.h:1594
static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fResult, BOOL fAnsi)
Definition: dialog.c:1289
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SetWindowLongPtrW
Definition: winuser.h:5215
static LRESULT DEFDLG_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, DIALOGINFO *dlgInfo)
Definition: dialog.c:1183
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
GLuint64EXT * result
Definition: glext.h:11304
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139

Referenced by dlg_test_aw_message().

◆ DIALOG_CreateControls32()

static BOOL DIALOG_CreateControls32 ( HWND  hwnd,
LPCSTR  template,
const DLG_TEMPLATE dlgTemplate,
HINSTANCE  hInst,
BOOL  unicode 
)
static

Definition at line 286 of file dialog.c.

288 {
289  DIALOGINFO * dlgInfo;
291  HWND hwndCtrl, hwndDefButton = 0;
292  INT items = dlgTemplate->nbItems;
293 
294  if (!(dlgInfo = GETDLGINFO(hwnd))) return FALSE;
295 
296  TRACE(" BEGIN\n" );
297  while (items--)
298  {
299  template = (LPCSTR)DIALOG_GetControl32( (const WORD *)template, &info,
300  dlgTemplate->dialogEx );
301  info.style &= ~WS_POPUP;
302  info.style |= WS_CHILD;
303 
304  if (info.style & WS_BORDER)
305  {
306  info.style &= ~WS_BORDER;
307  info.exStyle |= WS_EX_CLIENTEDGE;
308  }
309 
310  if (unicode)
311  {
312  hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
313  info.className, info.windowName,
314  info.style | WS_CHILD,
315  MulDiv(info.x, dlgInfo->xBaseUnit, 4),
316  MulDiv(info.y, dlgInfo->yBaseUnit, 8),
317  MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
318  MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
319  hwnd, (HMENU)(ULONG_PTR)info.id,
320  hInst, (LPVOID)info.data );
321  }
322  else
323  {
324  LPSTR class = (LPSTR)info.className;
325  LPSTR caption = (LPSTR)info.windowName;
326 
327  if (!IS_INTRESOURCE(class))
328  {
329  DWORD len = WideCharToMultiByte( CP_ACP, 0, info.className, -1, NULL, 0, NULL, NULL );
330  class = HeapAlloc( GetProcessHeap(), 0, len );
331  if (class != NULL)
332  WideCharToMultiByte( CP_ACP, 0, info.className, -1, class, len, NULL, NULL );
333  }
334  if (!IS_INTRESOURCE(caption))
335  {
336  DWORD len = WideCharToMultiByte( CP_ACP, 0, info.windowName, -1, NULL, 0, NULL, NULL );
337  caption = HeapAlloc( GetProcessHeap(), 0, len );
338  if (caption != NULL)
339  WideCharToMultiByte( CP_ACP, 0, info.windowName, -1, caption, len, NULL, NULL );
340  }
341 
342  if (class != NULL && caption != NULL)
343  {
344  hwndCtrl = CreateWindowExA( info.exStyle | WS_EX_NOPARENTNOTIFY,
345  class, caption, info.style | WS_CHILD,
346  MulDiv(info.x, dlgInfo->xBaseUnit, 4),
347  MulDiv(info.y, dlgInfo->yBaseUnit, 8),
348  MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
349  MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
350  hwnd, (HMENU)(ULONG_PTR)info.id,
351  hInst, (LPVOID)info.data );
352  }
353  else
354  hwndCtrl = NULL;
355  if (!IS_INTRESOURCE(class)) HeapFree( GetProcessHeap(), 0, class );
357  }
358 
359  if (info.windowNameFree)
360  {
361  HeapFree( GetProcessHeap(), 0, (LPVOID)info.windowName );
362  }
363 
364  if (!hwndCtrl)
365  {
366  WARN("control %s %s creation failed\n", debugstr_w(info.className),
367  debugstr_w(info.windowName));
368  if (dlgTemplate->style & DS_NOFAILCREATE) continue;
369  return FALSE;
370  }
371 
372  /* Send initialisation messages to the control */
373  if (dlgInfo->hUserFont) SendMessageW( hwndCtrl, WM_SETFONT,
374  (WPARAM)dlgInfo->hUserFont, 0 );
375  if (SendMessageW(hwndCtrl, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
376  {
377  /* If there's already a default push-button, set it back */
378  /* to normal and use this one instead. */
379  if (hwndDefButton)
380  SendMessageW( hwndDefButton, BM_SETSTYLE, BS_PUSHBUTTON, FALSE );
381  hwndDefButton = hwndCtrl;
382  dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID );
383  }
384  }
385  TRACE(" END\n" );
386  return TRUE;
387 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD nbItems
Definition: dialog.c:83
static const WORD * DIALOG_GetControl32(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx)
Definition: dialog.c:177
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WideCharToMultiByte
Definition: compat.h:101
char caption[64]
Definition: dialog.c:2033
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
#define DS_NOFAILCREATE
Definition: winuser.h:376
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t ULONG_PTR
Definition: typedefs.h:63
HFONT hUserFont
Definition: dialog.c:52
#define debugstr_w
Definition: kernel32.h:32
UINT yBaseUnit
Definition: dialog.c:55
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define GetWindowLongPtrA
Definition: winuser.h:4697
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define BM_SETSTYLE
Definition: winuser.h:1885
INT idResult
Definition: dialog.c:56
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL dialogEx
Definition: dialog.c:95
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
DWORD style
Definition: dialog.c:80
GLenum GLsizei len
Definition: glext.h:6722
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define WS_BORDER
Definition: pedump.c:625
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_POPUP
Definition: pedump.c:616
UINT xBaseUnit
Definition: dialog.c:54
#define WM_SETFONT
Definition: winuser.h:1632
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
static TCHAR * items[]
Definition: page1.c:45
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GWLP_ID
Definition: winuser.h:854
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
HINSTANCE hInst
Definition: dialog.c:39

Referenced by DIALOG_CreateIndirect().

◆ DIALOG_CreateIndirect()

static HWND DIALOG_CreateIndirect ( HINSTANCE  hInst,
LPCVOID  dlgTemplate,
HWND  owner,
DLGPROC  dlgProc,
LPARAM  param,
BOOL  unicode,
HWND modal_owner 
)
static

Definition at line 773 of file dialog.c.

776 {
777  HWND hwnd;
778  RECT rect;
779  POINT pos;
780  SIZE size;
781  DLG_TEMPLATE template;
782  DIALOGINFO * dlgInfo = NULL;
784  HWND disabled_owner = NULL;
785  HMENU hMenu = 0;
786  HFONT hUserFont = 0;
787  UINT flags = 0;
788  UINT xBaseUnit = LOWORD(units);
789  UINT yBaseUnit = HIWORD(units);
790 
791  /* Parse dialog template */
792 
793  if (!dlgTemplate) return 0;
794  dlgTemplate = DIALOG_ParseTemplate32( dlgTemplate, &template );
795 
796  /* Load menu */
797 
798  if (template.menuName) hMenu = LoadMenuW( hInst, template.menuName );
799 
800  /* Create custom font if needed */
801 
802  if (template.style & DS_SETFONT)
803  {
804  HDC dc = GetDC(0);
805 
806  if (template.pointSize == 0x7fff)
807  {
808  /* We get the message font from the non-client metrics */
809  NONCLIENTMETRICSW ncMetrics;
810 
811  ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW);
812  if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,
813  sizeof(NONCLIENTMETRICSW), &ncMetrics, 0))
814  {
815  hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont );
816  }
817  }
818  else
819  {
820  /* We convert the size to pixels and then make it -ve. This works
821  * for both +ve and -ve template.pointSize */
822  int pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
823  hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight,
824  template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
826  template.faceName );
827  }
828 
829  if (hUserFont)
830  {
831  SIZE charSize;
832  HFONT hOldFont = SelectObject( dc, hUserFont );
833  charSize.cx = GdiGetCharDimensions( dc, NULL, &charSize.cy );
834  if (charSize.cx)
835  {
836  xBaseUnit = charSize.cx;
837  yBaseUnit = charSize.cy;
838  }
839  SelectObject( dc, hOldFont );
840  }
841  ReleaseDC(0, dc);
842  TRACE("units = %d,%d\n", xBaseUnit, yBaseUnit );
843  }
844 
845  /* Create dialog main window */
846 
847  SetRect(&rect, 0, 0, MulDiv(template.cx, xBaseUnit, 4), MulDiv(template.cy, yBaseUnit, 8));
848  if (template.style & DS_CONTROL)
849  template.style &= ~(WS_CAPTION|WS_SYSMENU);
850  template.style |= DS_3DLOOK;
851  if (template.style & DS_MODALFRAME)
852  template.exStyle |= WS_EX_DLGMODALFRAME;
853  if ((template.style & DS_CONTROL) || !(template.style & WS_CHILD))
854  template.exStyle |= WS_EX_CONTROLPARENT;
855  AdjustWindowRectEx( &rect, template.style, (hMenu != 0), template.exStyle );
856  pos.x = rect.left;
857  pos.y = rect.top;
858  size.cx = rect.right - rect.left;
859  size.cy = rect.bottom - rect.top;
860 
861  if (template.x == CW_USEDEFAULT16)
862  {
863  pos.x = pos.y = CW_USEDEFAULT;
864  }
865  else
866  {
867  HMONITOR monitor = 0;
868  MONITORINFO mon_info;
869 
870  mon_info.cbSize = sizeof(mon_info);
871  if (template.style & DS_CENTER)
872  {
873  monitor = MonitorFromWindow( owner ? owner : GetActiveWindow(), MONITOR_DEFAULTTOPRIMARY );
874  GetMonitorInfoW( monitor, &mon_info );
875  pos.x = (mon_info.rcWork.left + mon_info.rcWork.right - size.cx) / 2;
876  pos.y = (mon_info.rcWork.top + mon_info.rcWork.bottom - size.cy) / 2;
877  }
878  else if (template.style & DS_CENTERMOUSE)
879  {
880  GetCursorPos( &pos );
881  monitor = MonitorFromPoint( pos, MONITOR_DEFAULTTOPRIMARY );
882  GetMonitorInfoW( monitor, &mon_info );
883  }
884  else
885  {
886  pos.x += MulDiv(template.x, xBaseUnit, 4);
887  pos.y += MulDiv(template.y, yBaseUnit, 8);
888  //
889  // REACTOS : Need an owner to be passed!!!
890  //
891  if (!(template.style & (WS_CHILD|DS_ABSALIGN)) && owner ) ClientToScreen( owner, &pos );
892  }
893  if ( !(template.style & WS_CHILD) )
894  {
895  INT dX, dY;
896 
897  /* try to fit it into the desktop */
898 
899  if (!monitor)
900  {
901  SetRect( &rect, pos.x, pos.y, pos.x + size.cx, pos.y + size.cy );
902  monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
903  GetMonitorInfoW( monitor, &mon_info );
904  }
905  if ((dX = pos.x + size.cx + GetSystemMetrics(SM_CXDLGFRAME) - mon_info.rcWork.right) > 0)
906  pos.x -= dX;
907  if ((dY = pos.y + size.cy + GetSystemMetrics(SM_CYDLGFRAME) - mon_info.rcWork.bottom) > 0)
908  pos.y -= dY;
909  if( pos.x < mon_info.rcWork.left ) pos.x = mon_info.rcWork.left;
910  if( pos.y < mon_info.rcWork.top ) pos.y = mon_info.rcWork.top;
911  }
912  }
913 
914  if (modal_owner && owner)
915  {
916  HWND parent = NULL;
917  /*
918  * Owner needs to be top level window. We need to duplicate the logic from server,
919  * because we need to disable it before creating dialog window. Note that we do that
920  * even if dialog has WS_CHILD, but only for modal dialogs, which matched what
921  * Windows does.
922  */
924  {
925  parent = GetParent( owner );
926  if (!parent || parent == GetDesktopWindow()) break;
927  owner = parent;
928  }
930  if (!parent) parent = GetAncestor( owner, GA_ROOT );
931 
932  if (parent)
933  {
934  owner = parent;
935 
936  if (IsWindowEnabled( owner ))
937  {
938  disabled_owner = owner;
939  EnableWindow( disabled_owner, FALSE );
940  }
941  }
942  *modal_owner = owner;
943  }
944 
945  if (unicode)
946  {
947  hwnd = CreateWindowExW(template.exStyle, template.className, template.caption,
948  template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy,
949  owner, hMenu, hInst, NULL );
950  }
951  else
952  {
953  LPCSTR class = (LPCSTR)template.className;
954  LPCSTR caption = (LPCSTR)template.caption;
955  LPSTR class_tmp = NULL;
956  LPSTR caption_tmp = NULL;
957 
958  if (!IS_INTRESOURCE(class))
959  {
960  DWORD len = WideCharToMultiByte( CP_ACP, 0, template.className, -1, NULL, 0, NULL, NULL );
961  class_tmp = HeapAlloc( GetProcessHeap(), 0, len );
962  WideCharToMultiByte( CP_ACP, 0, template.className, -1, class_tmp, len, NULL, NULL );
963  class = class_tmp;
964  }
965  if (!IS_INTRESOURCE(caption))
966  {
967  DWORD len = WideCharToMultiByte( CP_ACP, 0, template.caption, -1, NULL, 0, NULL, NULL );
968  caption_tmp = HeapAlloc( GetProcessHeap(), 0, len );
969  WideCharToMultiByte( CP_ACP, 0, template.caption, -1, caption_tmp, len, NULL, NULL );
970  caption = caption_tmp;
971  }
972  hwnd = CreateWindowExA(template.exStyle, class, caption,
973  template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy,
974  owner, hMenu, hInst, NULL );
975  HeapFree( GetProcessHeap(), 0, class_tmp );
976  HeapFree( GetProcessHeap(), 0, caption_tmp );
977  }
978 
979  if (!hwnd)
980  {
981  if (hUserFont) DeleteObject( hUserFont );
982  if (hMenu) DestroyMenu( hMenu );
983  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
984  return 0;
985  }
986 
987  /* moved this from the top of the method to here as DIALOGINFO structure
988  will be valid only after WM_CREATE message has been handled in DefDlgProc
989  All the members of the structure get filled here using temp variables */
990  dlgInfo = DIALOG_get_info( hwnd, TRUE );
991  // ReactOS
992  if (dlgInfo == NULL)
993  {
994  if (hUserFont) DeleteObject( hUserFont );
995  if (hMenu) DestroyMenu( hMenu );
996  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
997  return 0;
998  }
999  //
1000  dlgInfo->hwndFocus = 0;
1001  dlgInfo->hUserFont = hUserFont;
1002  dlgInfo->hMenu = hMenu;
1003  dlgInfo->xBaseUnit = xBaseUnit;
1004  dlgInfo->yBaseUnit = yBaseUnit;
1005  dlgInfo->flags = flags;
1006 
1007  if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
1008 
1009  if (unicode) SetWindowLongPtrW( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
1010  else SetWindowLongPtrA( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
1011 
1012  if (dlgProc && dlgInfo->hUserFont)
1013  SendMessageW( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
1014 
1015  /* Create controls */
1016 
1017  if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
1018  {
1019  /* Send initialisation messages and set focus */
1020 
1021  if (dlgProc)
1022  {
1023  HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
1024  if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
1025  if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && IsWindow( hwnd ) &&
1026  ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE)))
1027  {
1028  /* By returning TRUE, app has requested a default focus assignment.
1029  * WM_INITDIALOG may have changed the tab order, so find the first
1030  * tabstop control again. */
1031  focus = GetNextDlgTabItem( hwnd, 0, FALSE );
1032  if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
1033  if (focus)
1034  {
1035  if (SendMessageW( focus, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
1036  SendMessageW( focus, EM_SETSEL, 0, MAXLONG );
1037  SetFocus( focus );
1038  }
1039  }
1042  //DEFDLG_SaveFocus( hwnd );
1044  }
1047  SendMessageW( hwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0);
1049  if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE))
1050  {
1051  ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
1052  UpdateWindow( hwnd );
1053  IntNotifyWinEvent(EVENT_SYSTEM_DIALOGSTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
1054  }
1055  return hwnd;
1056  }
1057  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
1058  IntNotifyWinEvent(EVENT_SYSTEM_DIALOGEND, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
1059  if( IsWindow(hwnd) )
1060  {
1061  DestroyWindow( hwnd );
1063  if (owner)
1064  { ERR("DIALOG_CreateIndirect 1\n");
1067  { ERR("DIALOG_CreateIndirect SFW\n");
1069  }
1070  }
1072  }
1073  return 0;
1074 }
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define GA_ROOT
Definition: winuser.h:2743
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
HWND WINAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2330
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
HFONT WINAPI CreateFontW(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR)
#define DWLP_DLGPROC
Definition: winuser.h:865
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
#define WM_GETDLGCODE
Definition: winuser.h:1671
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WideCharToMultiByte
Definition: compat.h:101
#define FF_DONTCARE
Definition: wingdi.h:447
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define MAXLONG
Definition: umtypes.h:116
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2802
HDC WINAPI GetDC(_In_opt_ HWND)
char caption[64]
Definition: dialog.c:2033
#define CP_ACP
Definition: compat.h:99
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
static HDC
Definition: imagelist.c:92
static LPCSTR DIALOG_ParseTemplate32(LPCSTR template, DLG_TEMPLATE *result)
Definition: dialog.c:583
#define OBJID_WINDOW
Definition: winable.h:15
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:132
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CW_USEDEFAULT16
Definition: undocuser.h:167
#define DS_CENTER
Definition: winuser.h:369
LONG top
Definition: windef.h:292
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HWND WINAPI SetFocus(_In_opt_ HWND)
HDC dc
Definition: cylfrac.c:34
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4698
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
char * LPSTR
Definition: xmlstorage.h:182
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define DEFAULT_CHARSET
Definition: wingdi.h:383
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PROOF_QUALITY
Definition: wingdi.h:437
int32_t INT
Definition: typedefs.h:56
#define DLGC_HASSETSEL
Definition: winuser.h:2568
& rect
Definition: startmenu.cpp:1413
GLuint GLuint GLfloat weight
Definition: glext.h:11719
uint32_t ULONG_PTR
Definition: typedefs.h:63
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3982
#define DS_MODALFRAME
Definition: winuser.h:375
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
HFONT hUserFont
Definition: dialog.c:52
#define SM_CYDLGFRAME
Definition: winuser.h:958
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
LONG WINAPI GetDialogBaseUnits(VOID)
Definition: dialog.c:2076
BOOL WINAPI SetWindowContextHelpId(_In_ HWND, _In_ DWORD)
#define CHILDID_SELF
Definition: winable.h:14
#define CW_USEDEFAULT
Definition: winuser.h:225
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HWND WINAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2212
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
UINT yBaseUnit
Definition: dialog.c:55
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
LONG cx
Definition: windef.h:319
BOOL WINAPI IsWindowEnabled(_In_ HWND)
static BOOL DIALOG_CreateControls32(HWND hwnd, LPCSTR template, const DLG_TEMPLATE *dlgTemplate, HINSTANCE hInst, BOOL unicode)
Definition: dialog.c:286
const char * LPCSTR
Definition: xmlstorage.h:183
#define WS_CAPTION
Definition: pedump.c:624
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2708
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define SM_CXDLGFRAME
Definition: winuser.h:956
GLfloat param
Definition: glext.h:5796
#define EM_SETSEL
Definition: winuser.h:1979
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define DS_SETFONT
Definition: winuser.h:378
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
GLenum GLsizei len
Definition: glext.h:6722
#define SetWindowLongPtrA
Definition: winuser.h:5214
UINT flags
Definition: dialog.c:57
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND hwndFocus
Definition: dialog.c:51
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define SW_SHOWNORMAL
Definition: winuser.h:764
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
Definition: font.c:2145
#define DS_CENTERMOUSE
Definition: winuser.h:370
#define DS_3DLOOK
Definition: winuser.h:367
#define DS_CONTROL
Definition: winuser.h:372
DWORD cbSize
Definition: winuser.h:3726
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define WS_POPUP
Definition: pedump.c:616
unsigned int UINT
Definition: ndis.h:50
UINT xBaseUnit
Definition: dialog.c:54
#define DS_ABSALIGN
Definition: winuser.h:368
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WM_SETFONT
Definition: winuser.h:1632
HMENU hMenu
Definition: dialog.c:53
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
_Out_opt_ int * cx
Definition: commctrl.h:570
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI SetForegroundWindow(_In_ HWND)
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
LONG bottom
Definition: windef.h:294
#define LOGPIXELSY
Definition: wingdi.h:718
#define SetWindowLongPtrW
Definition: winuser.h:5215
GLfloat units
Definition: glext.h:11727
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LONG cy
Definition: windef.h:320
#define WM_INITDIALOG
Definition: winuser.h:1715
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define MulDiv(x, y, z)
Definition: gdifloat.h:86
HINSTANCE hInst
Definition: dialog.c:39

Referenced by CreateDialogIndirectParamAorW(), DialogBoxIndirectParamAorW(), DialogBoxParamA(), and DialogBoxParamW().

◆ DIALOG_DlgDirListA()

static INT DIALOG_DlgDirListA ( HWND  hDlg,
LPSTR  spec,
INT  idLBox,
INT  idStatic,
UINT  attrib,
BOOL  combo 
)
static

Definition at line 1465 of file dialog.c.

1467 {
1468  if (spec)
1469  {
1470  INT ret, len = MultiByteToWideChar( CP_ACP, 0, spec, -1, NULL, 0 );
1471  LPWSTR specW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
1472  if (specW == NULL)
1473  return FALSE;
1474  MultiByteToWideChar( CP_ACP, 0, spec, -1, specW, len );
1475  ret = DIALOG_DlgDirListW( hDlg, specW, idLBox, idStatic, attrib, combo );
1476  WideCharToMultiByte( CP_ACP, 0, specW, -1, spec, 0x7fffffff, NULL, NULL );
1477  HeapFree( GetProcessHeap(), 0, specW );
1478  return ret;
1479  }
1480  return DIALOG_DlgDirListW( hDlg, NULL, idLBox, idStatic, attrib, combo );
1481 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static INT DIALOG_DlgDirListW(HWND hDlg, LPWSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1376
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DlgDirListA(), and DlgDirListComboBoxA().

◆ DIALOG_DlgDirListW()

static INT DIALOG_DlgDirListW ( HWND  hDlg,
LPWSTR  spec,
INT  idLBox,
INT  idStatic,
UINT  attrib,
BOOL  combo 
)
static

Definition at line 1376 of file dialog.c.

1378 {
1379  HWND hwnd;
1380  LPWSTR orig_spec = spec;
1381  WCHAR any[] = {'*','.','*',0};
1382 
1383 #define SENDMSG(msg,wparam,lparam) \
1384  ((attrib & DDL_POSTMSGS) ? PostMessageW( hwnd, msg, wparam, lparam ) \
1385  : SendMessageW( hwnd, msg, wparam, lparam ))
1386 
1387  TRACE("%p %s %d %d %04x\n", hDlg, debugstr_w(spec), idLBox, idStatic, attrib );
1388 
1389  /* If the path exists and is a directory, chdir to it */
1390  if (!spec || !spec[0] || SetCurrentDirectoryW( spec )) spec = any;
1391  else
1392  {
1393  WCHAR *p, *p2;
1394  p = spec;
1395  if ((p2 = strchrW( p, ':' ))) p = p2 + 1;
1396  if ((p2 = strrchrW( p, '\\' ))) p = p2;
1397  if ((p2 = strrchrW( p, '/' ))) p = p2;
1398  if (p != spec)
1399  {
1400  WCHAR sep = *p;
1401  *p = 0;
1402  if (!SetCurrentDirectoryW( spec ))
1403  {
1404  *p = sep; /* Restore the original spec */
1405  return FALSE;
1406  }
1407  spec = p + 1;
1408  }
1409  }
1410 
1411  TRACE( "mask=%s\n", spec );
1412 
1413  if (idLBox && ((hwnd = GetDlgItem( hDlg, idLBox )) != 0))
1414  {
1415  if (attrib == DDL_DRIVES) attrib |= DDL_EXCLUSIVE;
1416 
1417  SENDMSG( combo ? CB_RESETCONTENT : LB_RESETCONTENT, 0, 0 );
1418  if (attrib & DDL_DIRECTORY)
1419  {
1420  if (!(attrib & DDL_EXCLUSIVE))
1421  {
1422  SENDMSG( combo ? CB_DIR : LB_DIR,
1423  attrib & ~(DDL_DIRECTORY | DDL_DRIVES),
1424  (LPARAM)spec );
1425  }
1426  SENDMSG( combo ? CB_DIR : LB_DIR,
1427  (attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
1428  (LPARAM)any );
1429  }
1430  else
1431  {
1432  SENDMSG( combo ? CB_DIR : LB_DIR, attrib, (LPARAM)spec );
1433  }
1434  }
1435 
1436  /* Convert path specification to uppercase */
1437  if (spec) CharUpperW(spec);
1438 
1439  if (idStatic && ((hwnd = GetDlgItem( hDlg, idStatic )) != 0))
1440  {
1441  WCHAR temp[MAX_PATH];
1442  GetCurrentDirectoryW( sizeof(temp)/sizeof(WCHAR), temp );
1443  CharLowerW( temp );
1444  /* Can't use PostMessage() here, because the string is on the stack */
1445  SetDlgItemTextW( hDlg, idStatic, temp );
1446  }
1447 
1448  if (orig_spec && (spec != orig_spec))
1449  {
1450  /* Update the original file spec */
1451  WCHAR *p = spec;
1452  while ((*orig_spec++ = *p++));
1453  }
1454 
1455  return TRUE;
1456 #undef SENDMSG
1457 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:1994
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:413
#define DDL_DIRECTORY
Definition: winuser.h:422
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
#define LB_RESETCONTENT
Definition: winuser.h:2016
#define debugstr_w
Definition: kernel32.h:32
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
Definition: dialog.c:2756
#define CB_RESETCONTENT
Definition: winuser.h:1920
#define SENDMSG(msg, wparam, lparam)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define DDL_DRIVES
Definition: winuser.h:425
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
#define CB_DIR
Definition: winuser.h:1899
static calc_node_t temp
Definition: rpn_ieee.c:38
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define DDL_EXCLUSIVE
Definition: winuser.h:426

Referenced by DIALOG_DlgDirListA(), DlgDirListComboBoxW(), and DlgDirListW().

◆ DIALOG_DlgDirSelect()

static BOOL DIALOG_DlgDirSelect ( HWND  hwnd,
LPWSTR  str,
INT  len,
INT  id,
BOOL  unicode,
BOOL  combo 
)
static

Definition at line 1488 of file dialog.c.

1490 {
1491  WCHAR *buffer, *ptr;
1492  INT item, size;
1493  BOOL ret;
1494  HWND listbox = GetDlgItem( hwnd, id );
1495 
1496  TRACE("%p %s %d\n", hwnd, unicode ? debugstr_w(str) : debugstr_a((LPSTR)str), id );
1497  if (!listbox) return FALSE;
1498 
1499  item = SendMessageW(listbox, combo ? CB_GETCURSEL : LB_GETCURSEL, 0, 0 );
1500  if (item == LB_ERR) return FALSE;
1501 
1502  size = SendMessageW(listbox, combo ? CB_GETLBTEXTLEN : LB_GETTEXTLEN, item, 0 );
1503  if (size == LB_ERR) return FALSE;
1504 
1505  if (!(buffer = HeapAlloc( GetProcessHeap(), 0, (size+2) * sizeof(WCHAR) ))) return FALSE;
1506 
1507  SendMessageW( listbox, combo ? CB_GETLBTEXT : LB_GETTEXT, item, (LPARAM)buffer );
1508 
1509  if ((ret = (buffer[0] == '['))) /* drive or directory */
1510  {
1511  if (buffer[1] == '-') /* drive */
1512  {
1513  buffer[3] = ':';
1514  buffer[4] = 0;
1515  ptr = buffer + 2;
1516  }
1517  else
1518  {
1519  buffer[strlenW(buffer)-1] = '\\';
1520  ptr = buffer + 1;
1521  }
1522  }
1523  else
1524  {
1525  /* Filenames without a dot extension must have one tacked at the end */
1526  if (strchrW(buffer, '.') == NULL)
1527  {
1528  buffer[strlenW(buffer)+1] = '\0';
1529  buffer[strlenW(buffer)] = '.';
1530  }
1531  ptr = buffer;
1532  }
1533 
1534  if (!unicode)
1535  {
1536  if (len > 0 && !WideCharToMultiByte( CP_ACP, 0, ptr, -1, (LPSTR)str, len, 0, 0 ))
1537  ((LPSTR)str)[len-1] = 0;
1538  }
1539  else lstrcpynW( str, ptr, len );
1540  HeapFree( GetProcessHeap(), 0, buffer );
1541  TRACE("Returning %d %s\n", ret, unicode ? debugstr_w(str) : debugstr_a((LPSTR)str) );
1542  return ret;
1543 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETLBTEXTLEN
Definition: winuser.h:1914
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define WideCharToMultiByte
Definition: compat.h:101
#define CB_GETLBTEXT
Definition: winuser.h:1913
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
#define CB_GETCURSEL
Definition: winuser.h:1904
#define lstrcpynW
Definition: compat.h:397
#define LB_ERR
Definition: winuser.h:2386
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define LB_GETTEXTLEN
Definition: winuser.h:2011
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int ret
#define LB_GETTEXT
Definition: winuser.h:2010
GLenum GLsizei len
Definition: glext.h:6722
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LB_GETCURSEL
Definition: winuser.h:2000
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DlgDirSelectComboBoxExA(), DlgDirSelectComboBoxExW(), DlgDirSelectExA(), and DlgDirSelectExW().

◆ DIALOG_DoDialogBox()

INT DIALOG_DoDialogBox ( HWND  hwnd,
HWND  owner 
)

Definition at line 503 of file dialog.c.

504 {
505  DIALOGINFO * dlgInfo;
506  MSG msg;
507  INT retval;
508  BOOL bFirstEmpty;
509  PWND pWnd;
510 
511  pWnd = ValidateHwnd(hwnd);
512  if (!pWnd) return -1;
513 
514  if (!(dlgInfo = GETDLGINFO(hwnd))) return -1;
515 
516  bFirstEmpty = TRUE;
517  if (!(dlgInfo->flags & DF_END)) /* was EndDialog called in WM_INITDIALOG ? */
518  {
519  for (;;)
520  {
521  if (!PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
522  {
523  if (bFirstEmpty)
524  {
525  /* ShowWindow the first time the queue goes empty */
527  bFirstEmpty = FALSE;
528  }
530  {
531  /* No message present -> send ENTERIDLE and wait */
533  }
534  GetMessageW( &msg, 0, 0, 0 );
535  }
536 
537  if (msg.message == WM_QUIT)
538  {
539  PostQuitMessage( msg.wParam );
540  if (!IsWindow( hwnd )) return 0;
541  break;
542  }
543 
544  /*
545  * If the user is pressing Ctrl+C, send a WM_COPY message.
546  * Guido Pola, CORE-4829, Is there another way to check if the Dialog is a MessageBox?
547  */
548  if (msg.message == WM_KEYDOWN &&
549  pWnd->state & WNDS_MSGBOX && // Yes!
551  {
552  if (msg.wParam == L'C' && GetKeyState(VK_CONTROL) < 0)
553  SendMessageW(hwnd, WM_COPY, 0, 0);
554  }
555 
556  if (!IsWindow( hwnd )) return 0;
557  if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd, &msg))
558  {
559  TranslateMessage( &msg );
560  DispatchMessageW( &msg );
561  }
562  if (!IsWindow( hwnd )) return 0;
563  if (dlgInfo->flags & DF_END) break;
564 
565  if (bFirstEmpty && msg.message == WM_TIMER)
566  {
568  bFirstEmpty = FALSE;
569  }
570  }
571  }
572  retval = dlgInfo->idResult;
573  DestroyWindow( hwnd );
574  return retval;
575 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define MSGF_DIALOGBOX
Definition: winuser.h:1159
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WM_QUIT
Definition: winuser.h:1605
#define GetWindowLongPtrW
Definition: winuser.h:4698
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:56
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define WM_COPY
Definition: winuser.h:1823
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_KEYDOWN
Definition: winuser.h:1691
LONG_PTR LPARAM
Definition: windef.h:208
SHORT WINAPI GetKeyState(_In_ int)
#define WM_ENTERIDLE
Definition: winuser.h:1725
#define DS_NOIDLEMSG
Definition: winuser.h:377
INT idResult
Definition: dialog.c:56
#define WM_TIMER
Definition: winuser.h:1718
#define WNDS_MSGBOX
Definition: ntuser.h:578
static const WCHAR L[]
Definition: oid.c:1250
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
UINT flags
Definition: dialog.c:57
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
#define SW_SHOWNORMAL
Definition: winuser.h:764
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD state
Definition: ntuser.h:665
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define VK_CONTROL
Definition: winuser.h:2157
BOOL WINAPI IsDialogMessageW(HWND hDlg, LPMSG lpMsg)
Definition: dialog.c:2471
#define msg(x)
Definition: auth_time.c:54
#define DF_END
Definition: dialog.c:37
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Referenced by DialogBoxIndirectParamAorW(), DialogBoxParamA(), and DialogBoxParamW().

◆ DIALOG_FindMsgDestination()

static HWND DIALOG_FindMsgDestination ( HWND  hwndDlg)
static

Definition at line 475 of file dialog.c.

476 {
477  while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL)
478  {
479  PWND pWnd;
480  HWND hParent = GetParent(hwndDlg);
481  if (!hParent) break;
482 // ReactOS
483  if (!IsWindow(hParent)) break;
484 
485  pWnd = ValidateHwnd(hParent);
486  // FIXME: Use pWnd->fnid == FNID_DESKTOP
487  if (!pWnd || !TestWindowProcess(pWnd) || hParent == GetDesktopWindow()) break;
488 
489  if (!(pWnd->state & WNDS_DIALOGWINDOW))
490  {
491  break;
492  }
493 
494  hwndDlg = hParent;
495  }
496 
497  return hwndDlg;
498 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL FASTCALL TestWindowProcess(PWND)
Definition: misc.c:176
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
#define WNDS_DIALOGWINDOW
Definition: ntuser.h:589
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
HWND WINAPI GetParent(_In_ HWND)
#define DS_CONTROL
Definition: winuser.h:372
DWORD state
Definition: ntuser.h:665

Referenced by DEFDLG_Proc(), and IsDialogMessageW().

◆ DIALOG_FixChildrenOnChangeFocus()

static void DIALOG_FixChildrenOnChangeFocus ( HWND  hwndDlg,
HWND  hwndNext 
)
static

Definition at line 2391 of file dialog.c.

2392 {
2393  INT dlgcode_next = SendMessageW (hwndNext, WM_GETDLGCODE, 0, 0);
2394  /* INT dlgcode_dlg = SendMessageW (hwndDlg, WM_GETDLGCODE, 0, 0); */
2395  /* Windows does ask for this. I don't know why yet */
2396 
2398 
2399  /* If the button that is getting the focus WAS flagged as the default
2400  * pushbutton then ask the dialog what it thinks the default is and
2401  * set that in the default style.
2402  */
2403  if (dlgcode_next & DLGC_DEFPUSHBUTTON)
2404  {
2405  DWORD def_id = SendMessageW (hwndDlg, DM_GETDEFID, 0, 0);
2406  if (HIWORD(def_id) == DC_HASDEFID)
2407  {
2408  HWND hwndDef;
2409  def_id = LOWORD(def_id);
2410  hwndDef = GetDlgItem (hwndDlg, def_id);
2411  if (hwndDef)
2412  {
2413  INT dlgcode_def = SendMessageW (hwndDef, WM_GETDLGCODE, 0, 0);
2414  /* I know that if it is a button then it should already be a
2415  * UNDEFPUSHBUTTON, since we have just told the buttons to
2416  * change style. But maybe they ignored our request
2417  */
2418  if ((dlgcode_def & DLGC_BUTTON) &&
2419  (dlgcode_def & DLGC_UNDEFPUSHBUTTON))
2420  {
2422  }
2423  }
2424  }
2425  }
2426  else if ((dlgcode_next & DLGC_BUTTON) && (dlgcode_next & DLGC_UNDEFPUSHBUTTON))
2427  {
2429  /* I wonder why it doesn't send a DM_SETDEFID */
2430  }
2431 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2570
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
static BOOL CALLBACK DIALOG_FixOneChildOnChangeFocus(HWND hwndChild, LPARAM lParam)
Definition: dialog.c:2375
int32_t INT
Definition: typedefs.h:56
#define DM_GETDEFID
Definition: winuser.h:2059
#define DC_HASDEFID
Definition: winuser.h:2563
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define BM_SETSTYLE
Definition: winuser.h:1885
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DLGC_BUTTON
Definition: winuser.h:2574
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82

Referenced by IsDialogMessageW().

◆ DIALOG_FixOneChildOnChangeFocus()

static BOOL CALLBACK DIALOG_FixOneChildOnChangeFocus ( HWND  hwndChild,
LPARAM  lParam 
)
static

Definition at line 2375 of file dialog.c.

2377 {
2378  /* If a default pushbutton then no longer default */
2379  if (DLGC_DEFPUSHBUTTON & SendMessageW (hwndChild, WM_GETDLGCODE, 0, 0))
2380  SendMessageW (hwndChild, BM_SETSTYLE, BS_PUSHBUTTON, TRUE);
2381  return TRUE;
2382 }
#define TRUE
Definition: types.h:120
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2569
#define BM_SETSTYLE
Definition: winuser.h:1885
#define BS_PUSHBUTTON
Definition: pedump.c:651
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by DIALOG_FixChildrenOnChangeFocus().

◆ DIALOG_get_info()

DIALOGINFO* DIALOG_get_info ( HWND  hWnd,
BOOL  create 
)

Definition at line 132 of file dialog.c.

133 {
134  PWND pWindow;
135  DIALOGINFO* dlgInfo;
136 
137  pWindow = ValidateHwnd( hWnd );
138  if (!pWindow)
139  {
140  return NULL;
141  }
142 
144 
145  if (!dlgInfo && create)
146  {
147  if (pWindow && pWindow->cbwndExtra >= DLGWINDOWEXTRA)
148  {
149  if (!(dlgInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dlgInfo) )))
150  return NULL;
151 
152  dlgInfo->idResult = IDOK;
153  SETDLGINFO( hWnd, dlgInfo );
154  }
155  else
156  {
157  return NULL;
158  }
159  }
160 
161  if (dlgInfo)
162  {
163  if (!(pWindow->state & WNDS_DIALOGWINDOW))
164  {
165  NtUserxSetDialogPointer( hWnd, dlgInfo );
166  }
167  }
168  return dlgInfo;
169 }
#define IDOK
Definition: winuser.h:824
HWND hWnd
Definition: settings.c:17
EXTINLINE VOID NtUserxSetDialogPointer(HWND hWnd, PVOID dlgInfo)
Definition: ntwrapper.h:716
#define GetWindowLongPtrW
Definition: winuser.h:4698
ULONG cbwndExtra
Definition: ntuser.h:702
smooth NULL
Definition: ftsmooth.c:416
#define DWLP_ROS_DIALOGINFO
Definition: dialog.c:39
#define SETDLGINFO(hwnd, info)
Definition: dialog.c:41
#define WNDS_DIALOGWINDOW
Definition: ntuser.h:589
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
INT idResult
Definition: dialog.c:56
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define DLGWINDOWEXTRA
Definition: winuser.h:2519
Definition: ntuser.h:657
DWORD state
Definition: ntuser.h:665
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const struct access_res create[16]
Definition: package.c:7720

Referenced by DefDlgProcA(), DefDlgProcW(), and DIALOG_CreateIndirect().

◆ DIALOG_GetControl32()

static const WORD* DIALOG_GetControl32 ( const WORD p,
DLG_CONTROL_INFO info,
BOOL  dialogEx 
)
static

Definition at line 177 of file dialog.c.

179 {
180  if (dialogEx)
181  {
182  info->helpId = GET_DWORD(p); p += 2;
183  info->exStyle = GET_DWORD(p); p += 2;
184  info->style = GET_DWORD(p); p += 2;
185  }
186  else
187  {
188  info->helpId = 0;
189  info->style = GET_DWORD(p); p += 2;
190  info->exStyle = GET_DWORD(p); p += 2;
191  }
192  info->x = GET_WORD(p); p++;
193  info->y = GET_WORD(p); p++;
194  info->cx = GET_WORD(p); p++;
195  info->cy = GET_WORD(p); p++;
196 
197  if (dialogEx)
198  {
199  /* id is a DWORD for DIALOGEX */
200  info->id = GET_DWORD(p);
201  p += 2;
202  }
203  else
204  {
205  info->id = GET_WORD(p);
206  p++;
207  }
208 
209  if (GET_WORD(p) == 0xffff)
210  {
211  static const WCHAR class_names[6][10] =
212  {
213  { 'B','u','t','t','o','n', }, /* 0x80 */
214  { 'E','d','i','t', }, /* 0x81 */
215  { 'S','t','a','t','i','c', }, /* 0x82 */
216  { 'L','i','s','t','B','o','x', }, /* 0x83 */
217  { 'S','c','r','o','l','l','B','a','r', }, /* 0x84 */
218  { 'C','o','m','b','o','B','o','x', } /* 0x85 */
219  };
220  WORD id = GET_WORD(p+1);
221  /* Windows treats dialog control class ids 0-5 same way as 0x80-0x85 */
222  if ((id >= 0x80) && (id <= 0x85)) id -= 0x80;
223  if (id <= 5)
224  {
225  info->className = class_names[id];
226  }
227  else
228  {
229  info->className = NULL;
230  /* FIXME: load other classes here? */
231  ERR("Unknown built-in class id %04x\n", id );
232  }
233  p += 2;
234  }
235  else
236  {
237  info->className = (LPCWSTR)p;
238  p += strlenW( info->className ) + 1;
239  }
240 
241  if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
242  {
244  info->windowName = HeapAlloc( GetProcessHeap(), 0, sizeof(L"#65535") );
245  if (info->windowName != NULL)
246  {
247  wsprintf((LPWSTR)info->windowName, L"#%u", GET_WORD(p + 1));
248  info->windowNameFree = TRUE;
249  }
250  else
251  {
252  info->windowNameFree = FALSE;
253  }
254  p += 2;
255  }
256  else
257  {
258  info->windowName = (LPCWSTR)p;
259  info->windowNameFree = FALSE;
260  p += strlenW( info->windowName ) + 1;
261  }
262 
263  TRACE(" %s %s %ld, %d, %d, %d, %d, %08x, %08x, %08x\n",
264  debugstr_w( info->className ), debugstr_w( info->windowName ),
265  info->id, info->x, info->y, info->cx, info->cy,
266  info->style, info->exStyle, info->helpId );
267 
268  if (GET_WORD(p))
269  {
270  info->data = p;
271  p += GET_WORD(p) / sizeof(WORD);
272  }
273  else info->data = NULL;
274  p++;
275 
276  /* Next control is on dword boundary */
277  return (const WORD *)(((UINT_PTR)p + 3) & ~3);
278 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define GET_WORD(ptr)
Definition: dialog.c:42
static int id(HWND h)
Definition: dialog.c:258
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define GET_DWORD(ptr)
Definition: dialog.c:43
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:109
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define wsprintf
Definition: winuser.h:5731

Referenced by DIALOG_CreateControls32().

◆ DIALOG_GetNextTabItem()

static HWND DIALOG_GetNextTabItem ( HWND  hwndMain,
HWND  hwndDlg,
HWND  hwndCtrl,
BOOL  fPrevious 
)
static

Definition at line 1312 of file dialog.c.

1313 {
1314  LONG dsStyle;
1315  LONG exStyle;
1316  UINT wndSearch = fPrevious ? GW_HWNDPREV : GW_HWNDNEXT;
1317  HWND retWnd = 0;
1318  HWND hChildFirst = 0;
1319 
1320  if(!hwndCtrl)
1321  {
1322  hChildFirst = GetWindow(hwndDlg,GW_CHILD);
1323  if(fPrevious) hChildFirst = GetWindow(hChildFirst,GW_HWNDLAST);
1324  }
1325  else if (IsChild( hwndMain, hwndCtrl ))
1326  {
1327  hChildFirst = GetWindow(hwndCtrl,wndSearch);
1328  if(!hChildFirst)
1329  {
1330  if(GetParent(hwndCtrl) != hwndMain)
1331  /* i.e. if we are not at the top level of the recursion */
1332  hChildFirst = GetWindow(GetParent(hwndCtrl),wndSearch);
1333  else
1334  hChildFirst = GetWindow(hwndCtrl, fPrevious ? GW_HWNDLAST : GW_HWNDFIRST);
1335  }
1336  }
1337 
1338  while(hChildFirst)
1339  {
1340  dsStyle = GetWindowLongPtrA(hChildFirst,GWL_STYLE);
1341  exStyle = GetWindowLongPtrA(hChildFirst,GWL_EXSTYLE);
1342  if( (exStyle & WS_EX_CONTROLPARENT) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
1343  {
1344  HWND retWnd;
1345  retWnd = DIALOG_GetNextTabItem(hwndMain,hChildFirst,NULL,fPrevious );
1346  if (retWnd) return (retWnd);
1347  }
1348  else if( (dsStyle & WS_TABSTOP) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
1349  {
1350  return (hChildFirst);
1351  }
1352  hChildFirst = GetWindow(hChildFirst,wndSearch);
1353  }
1354  if(hwndCtrl)
1355  {
1356  HWND hParent = GetParent(hwndCtrl);
1357  while(hParent)
1358  {
1359  if(hParent == hwndMain) break;
1360  retWnd = DIALOG_GetNextTabItem(hwndMain,GetParent(hParent),hParent,fPrevious );
1361  if(retWnd) break;
1363  }
1364  if(!retWnd)
1365  retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,NULL,fPrevious );
1366  }
1367  return retWnd ? retWnd : hwndCtrl;
1368 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define WS_DISABLED
Definition: pedump.c:621
#define GW_CHILD
Definition: winuser.h:758
HWND hwndMain
Definition: solitaire.cpp:12
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetWindowLongPtrA
Definition: winuser.h:4697
#define GW_HWNDLAST
Definition: winuser.h:760
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define WS_TABSTOP
Definition: pedump.c:634
#define GW_HWNDFIRST
Definition: winuser.h:759
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
static HWND DIALOG_GetNextTabItem(HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious)
Definition: dialog.c:1312
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define WS_VISIBLE
Definition: pedump.c:620
#define GW_HWNDPREV
Definition: winuser.h:757

Referenced by GetNextDlgTabItem().

◆ DIALOG_IdToHwnd()

static HWND DIALOG_IdToHwnd ( HWND  hwndDlg,
INT  id 
)
static

Definition at line 2441 of file dialog.c.

2442 {
2443  int i;
2444  HWND *list = WIN_ListChildren( hwndDlg );
2445  HWND ret = 0;
2446 
2447  if (!list) return 0;
2448 
2449  for (i = 0; list[i]; i++)
2450  {
2451  if (GetWindowLongPtrW( list[i], GWLP_ID ) == id)
2452  {
2453  ret = list[i];
2454  break;
2455  }
2456 
2457  /* Recurse into every child */
2458  if ((ret = DIALOG_IdToHwnd( list[i], id ))) break;
2459  }
2460 
2461  HeapFree( GetProcessHeap(), 0, list );
2462  return ret;
2463 }
#define GetWindowLongPtrW
Definition: winuser.h:4698
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HWND DIALOG_IdToHwnd(HWND hwndDlg, INT id)
Definition: dialog.c:2441
#define GetProcessHeap()
Definition: compat.h:395
int ret
Definition: _list.h:228
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GWLP_ID
Definition: winuser.h:854

Referenced by IsDialogMessageW().

◆ DIALOG_IsAccelerator()

static BOOL DIALOG_IsAccelerator ( HWND  hwnd,
HWND  hwndDlg,
WPARAM  wParam 
)
static

Definition at line 393 of file dialog.c.

394 {
395  HWND hwndControl = hwnd;
396  HWND hwndNext;
397  INT dlgCode;
398  WCHAR buffer[128];
399 
400  do
401  {
402  DWORD style = GetWindowLongPtrW( hwndControl, GWL_STYLE );
403  if ((style & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE)
404  {
405  dlgCode = SendMessageW( hwndControl, WM_GETDLGCODE, 0, 0 );
406  if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) &&
407  GetWindowTextW( hwndControl, buffer, sizeof(buffer)/sizeof(WCHAR) ))
408  {
409  /* find the accelerator key */
410  LPWSTR p = buffer - 2;
411 
412  do
413  {
414  p = strchrW( p + 2, '&' );
415  }
416  while (p != NULL && p[1] == '&');
417 
418  /* and check if it's the one we're looking for */
419  if (p != NULL && toupperW( p[1] ) == toupperW( wParam ) )
420  {
421  if ((dlgCode & DLGC_STATIC) || (style & 0x0f) == BS_GROUPBOX )
422  {
423  /* set focus to the control */
424  SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndControl, 1);
425  /* and bump it on to next */
426  SendMessageW( hwndDlg, WM_NEXTDLGCTL, 0, 0);
427  }
428  else if (dlgCode & DLGC_BUTTON)
429  {
430  /* send BM_CLICK message to the control */
431  SendMessageW( hwndControl, BM_CLICK, 0, 0 );
432  }
433  return TRUE;
434  }
435  }
436  hwndNext = GetWindow( hwndControl, GW_CHILD );
437  }
438  else hwndNext = 0;
439 
440  if (!hwndNext) hwndNext = GetWindow( hwndControl, GW_HWNDNEXT );
441 
442  while (!hwndNext && hwndControl)
443  {
444  hwndControl = GetParent( hwndControl );
445  if (hwndControl == hwndDlg)
446  {
447  if(hwnd==hwndDlg) /* prevent endless loop */
448  {
449  hwndNext=hwnd;
450  break;
451  }
452  hwndNext = GetWindow( hwndDlg, GW_CHILD );
453  }
454  else
455  hwndNext = GetWindow( hwndControl, GW_HWNDNEXT );
456  }
457  hwndControl = hwndNext;
458  }
459  while (hwndControl && (hwndControl != hwnd));
460 
461  return FALSE;
462 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define GW_CHILD
Definition: winuser.h:758
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
GLuint buffer
Definition: glext.h:5915
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4698
int32_t INT
Definition: typedefs.h:56
#define BS_GROUPBOX
Definition: pedump.c:658
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
#define BM_CLICK
Definition: winuser.h:1878
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GWL_STYLE
Definition: winuser.h:846
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
HWND WINAPI GetParent(_In_ HWND)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
#define DLGC_BUTTON
Definition: winuser.h:2574
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define DLGC_STATIC
Definition: winuser.h:2573

Referenced by IsDialogMessageW().

◆ DIALOG_ParseTemplate32()

static LPCSTR DIALOG_ParseTemplate32 ( LPCSTR  template,
DLG_TEMPLATE result 
)
static

Definition at line 583 of file dialog.c.

584 {
585  const WORD *p = (const WORD *)template;
586  WORD signature;
587  WORD dlgver;
588 
589  dlgver = GET_WORD(p); p++;
590  signature = GET_WORD(p); p++;
591 
592  if (dlgver == 1 && signature == 0xffff) /* DIALOGEX resource */
593  {
594  result->dialogEx = TRUE;
595  result->helpId = GET_DWORD(p); p += 2;
596  result->exStyle = GET_DWORD(p); p += 2;
597  result->style = GET_DWORD(p); p += 2;
598  }
599  else
600  {
601  result->style = GET_DWORD(p - 2);
602  result->dialogEx = FALSE;
603  result->helpId = 0;
604  result->exStyle = GET_DWORD(p); p += 2;
605  }
606  result->nbItems = GET_WORD(p); p++;
607  result->x = GET_WORD(p); p++;
608  result->y = GET_WORD(p); p++;
609  result->cx = GET_WORD(p); p++;
610  result->cy = GET_WORD(p); p++;
611  TRACE("DIALOG%s %d, %d, %d, %d, %d\n",
612  result->dialogEx ? "EX" : "", result->x, result->y,
613  result->cx, result->cy, result->helpId );
614  TRACE(" STYLE 0x%08x\n", result->style );
615  TRACE(" EXSTYLE 0x%08x\n", result->exStyle );
616 
617  /* Get the menu name */
618 
619  switch(GET_WORD(p))
620  {
621  case 0x0000:
622  result->menuName = NULL;
623  p++;
624  break;
625  case 0xffff:
626  result->menuName = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
627  p += 2;
628  TRACE(" MENU %04x\n", LOWORD(result->menuName) );
629  break;
630  default:
631  result->menuName = (LPCWSTR)p;
632  TRACE(" MENU %s\n", debugstr_w(result->menuName) );
633  p += strlenW( result->menuName ) + 1;
634  break;
635  }
636 
637  /* Get the class name */
638 
639  switch(GET_WORD(p))
640  {
641  case 0x0000:
642  result->className = WC_DIALOG;
643  p++;
644  break;
645  case 0xffff:
646  result->className = (LPCWSTR)(UINT_PTR)GET_WORD( p + 1 );
647  p += 2;
648  TRACE(" CLASS %04x\n", LOWORD(result->className) );
649  break;
650  default:
651  result->className = (LPCWSTR)p;
652  TRACE(" CLASS %s\n", debugstr_w( result->className ));
653  p += strlenW( result->className ) + 1;
654  break;
655  }
656 
657  /* Get the window caption */
658 
659  result->caption = (LPCWSTR)p;
660  p += strlenW( result->caption ) + 1;
661  TRACE(" CAPTION %s\n", debugstr_w( result->caption ) );
662 
663  /* Get the font name */
664 
665  result->pointSize = 0;
666  result->faceName = NULL;
667  result->weight = FW_DONTCARE;
668  result->italic = FALSE;
669 
670  if (result->style & DS_SETFONT)
671  {
672  result->pointSize = GET_WORD(p);
673  p++;
674 
675  /* If pointSize is 0x7fff, it means that we need to use the font
676  * in NONCLIENTMETRICSW.lfMessageFont, and NOT read the weight,
677  * italic, and facename from the dialog template.
678  */
679  if (result->pointSize == 0x7fff)
680  {
681  /* We could call SystemParametersInfo here, but then we'd have
682  * to convert from pixel size to point size (which can be
683  * imprecise).
684  */
685  TRACE(" FONT: Using message box font\n");
686  }
687  else
688  {
689  if (result->dialogEx)
690  {
691  result->weight = GET_WORD(p); p++;
692  result->italic = LOBYTE(GET_WORD(p)); p++;
693  }
694  result->faceName = (LPCWSTR)p;
695  p += strlenW( result->faceName ) + 1;
696 
697  TRACE(" FONT %d, %s, %d, %s\n",
698  result->pointSize, debugstr_w( result->faceName ),
699  result->weight, result->italic ? "TRUE" : "FALSE" );
700  }
701  }
702 
703  /* First control is on dword boundary */
704  return (LPCSTR)((((UINT_PTR)p) + 3) & ~3);
705 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LOBYTE(W)
Definition: jmemdos.c:487
#define GET_WORD(ptr)
Definition: dialog.c:42
#define WC_DIALOG
Definition: undocuser.h:11
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define GET_DWORD(ptr)
Definition: dialog.c:43
const char * LPCSTR
Definition: xmlstorage.h:183
#define TRACE(s)
Definition: solgame.cpp:4
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define DS_SETFONT
Definition: winuser.h:378
#define FW_DONTCARE
Definition: wingdi.h:367
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DIALOG_CreateIndirect().

◆ DialogBoxIndirectParamA()

INT_PTR WINAPI DialogBoxIndirectParamA ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  hDialogTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1793 of file dialog.c.

1799 {
1800  return DialogBoxIndirectParamAorW( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, DLG_ISANSI);
1801 }
#define DLG_ISANSI
Definition: dialog.c:44
HINSTANCE hInstance
Definition: charmap.c:20
INT_PTR WINAPI DialogBoxIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam, DWORD Flags)
Definition: dialog.c:1769

◆ DialogBoxIndirectParamAorW()

INT_PTR WINAPI DialogBoxIndirectParamAorW ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  hDialogTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam,
DWORD  Flags 
)

Definition at line 1769 of file dialog.c.

1776 {
1777 /* FIXME:
1778  * This function might be obsolete since I don't think it is exported by NT
1779  * Also wine has one more parameter identifying weather it should call
1780  * the function with unicode or not
1781  */
1782  HWND hWnd = DIALOG_CreateIndirect( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, Flags == DLG_ISANSI ? FALSE : TRUE, &hWndParent );
1783  if (hWnd) return DIALOG_DoDialogBox( hWnd, hWndParent );
1784  return -1;
1785 }
#define TRUE
Definition: types.h:120
INT DIALOG_DoDialogBox(HWND hwnd, HWND owner)
Definition: dialog.c:503
#define DLG_ISANSI
Definition: dialog.c:44
HWND hWnd
Definition: settings.c:17
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
HINSTANCE hInstance
Definition: charmap.c:20
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:773

Referenced by DialogBoxIndirectParamA(), and DialogBoxIndirectParamW().

◆ DialogBoxIndirectParamW()

INT_PTR WINAPI DialogBoxIndirectParamW ( HINSTANCE  hInstance,
LPCDLGTEMPLATE  hDialogTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1809 of file dialog.c.

1815 {
1816  return DialogBoxIndirectParamAorW( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, 0);
1817 }
HINSTANCE hInstance
Definition: charmap.c:20
INT_PTR WINAPI DialogBoxIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam, DWORD Flags)
Definition: dialog.c:1769

◆ DialogBoxParamA()

INT_PTR WINAPI DialogBoxParamA ( HINSTANCE  hInstance,
LPCSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1825 of file dialog.c.

1831 {
1832  HWND hwnd;
1833  HRSRC hrsrc;
1836  if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG )) ||
1837  !(ptr = LoadResource(hInstance, hrsrc)))
1838  {
1840  return -1;
1841  }
1842  if (hWndParent != NULL && !IsWindow(hWndParent))
1843  {
1845  return 0;
1846  }
1847  hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, FALSE, &hWndParent );
1848  if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent);
1849  return -1;
1850 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
INT DIALOG_DoDialogBox(HWND hwnd, HWND owner)
Definition: dialog.c:503
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1121
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
HINSTANCE hInstance
Definition: charmap.c:20
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define RT_DIALOG
Definition: pedump.c:367
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define SetLastError(x)
Definition: compat.h:409
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:773

Referenced by test_DialogBoxParam(), and test_DisabledDialogTest().

◆ DialogBoxParamW()

INT_PTR WINAPI DialogBoxParamW ( HINSTANCE  hInstance,
LPCWSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  dwInitParam 
)

Definition at line 1858 of file dialog.c.

1864 {
1865  HWND hwnd;
1866  HRSRC hrsrc;
1869  if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG )) ||
1870  !(ptr = LoadResource(hInstance, hrsrc)))
1871  {
1873  return -1;
1874  }
1875  if (hWndParent != NULL && !IsWindow(hWndParent))
1876  {
1878  return 0;
1879  }
1880  hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, TRUE, &hWndParent );
1881  if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent);
1882  return -1;
1883 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
INT DIALOG_DoDialogBox(HWND hwnd, HWND owner)
Definition: dialog.c:503
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define ERROR_RESOURCE_NAME_NOT_FOUND
Definition: winerror.h:1121
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
HINSTANCE hInstance
Definition: charmap.c:20
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
#define RT_DIALOG
Definition: pedump.c:367
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define SetLastError(x)
Definition: compat.h:409
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:773

Referenced by DIALOG_CopyMove(), DIALOG_Execute(), DIALOG_GroupAttributes(), DIALOG_New(), DIALOG_ProgramAttributes(), DIALOG_Symbol(), SetupPromptForDiskW(), and test_DialogBoxParam().

◆ DlgDirListA()

int WINAPI DlgDirListA ( HWND  hDlg,
LPSTR  lpPathSpec,
int  nIDListBox,
int  nIDStaticPath,
UINT  uFileType 
)

Definition at line 1891 of file dialog.c.

1897 {
1898  return DIALOG_DlgDirListA( hDlg, lpPathSpec, nIDListBox, nIDStaticPath, uFileType, FALSE );
1899 }
static INT DIALOG_DlgDirListA(HWND hDlg, LPSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1465

◆ DlgDirListComboBoxA()

int WINAPI DlgDirListComboBoxA ( HWND  hDlg,
LPSTR  lpPathSpec,
int  nIDComboBox,
int  nIDStaticPath,
UINT  uFiletype 
)

Definition at line 1907 of file dialog.c.

1913 {
1914  return DIALOG_DlgDirListA( hDlg, lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype, TRUE );
1915 }
#define TRUE
Definition: types.h:120
static INT DIALOG_DlgDirListA(HWND hDlg, LPSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1465

◆ DlgDirListComboBoxW()

int WINAPI DlgDirListComboBoxW ( HWND  hDlg,
LPWSTR  lpPathSpec,
int  nIDComboBox,
int  nIDStaticPath,
UINT  uFiletype 
)

Definition at line 1923 of file dialog.c.

1929 {
1930  return DIALOG_DlgDirListW( hDlg, lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype, TRUE );
1931 }
#define TRUE
Definition: types.h:120
static INT DIALOG_DlgDirListW(HWND hDlg, LPWSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1376

◆ DlgDirListW()

int WINAPI DlgDirListW ( HWND  hDlg,
LPWSTR  lpPathSpec,
int  nIDListBox,
int  nIDStaticPath,
UINT  uFileType 
)

Definition at line 1939 of file dialog.c.

1945 {
1946  return DIALOG_DlgDirListW( hDlg, lpPathSpec, nIDListBox, nIDStaticPath, uFileType, FALSE );
1947 }
static INT DIALOG_DlgDirListW(HWND hDlg, LPWSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1376

◆ DlgDirSelectComboBoxExA()

BOOL WINAPI DlgDirSelectComboBoxExA ( HWND  hDlg,
LPSTR  lpString,
int  nCount,
int  nIDComboBox 
)

Definition at line 1955 of file dialog.c.

1960 {
1961  return DIALOG_DlgDirSelect( hDlg, (LPWSTR)lpString, nCount, nIDComboBox, FALSE, TRUE );
1962 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1488
#define TRUE
Definition: types.h:120
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ DlgDirSelectComboBoxExW()

BOOL WINAPI DlgDirSelectComboBoxExW ( HWND  hDlg,
LPWSTR  lpString,
int  nCount,
int  nIDComboBox 
)

Definition at line 1970 of file dialog.c.

1975 {
1976  return DIALOG_DlgDirSelect( hDlg, (LPWSTR)lpString, nCount, nIDComboBox, TRUE, TRUE );
1977 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1488
#define TRUE
Definition: types.h:120
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ DlgDirSelectExA()

BOOL WINAPI DlgDirSelectExA ( HWND  hDlg,
LPSTR  lpString,
int  nCount,
int  nIDListBox 
)

Definition at line 1985 of file dialog.c.

1990 {
1991  return DIALOG_DlgDirSelect( hDlg, (LPWSTR)lpString, nCount, nIDListBox, FALSE, FALSE );
1992 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1488
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ DlgDirSelectExW()

BOOL WINAPI DlgDirSelectExW ( HWND  hDlg,
LPWSTR  lpString,
int  nCount,
int  nIDListBox 
)

Definition at line 2000 of file dialog.c.

2005 {
2006  return DIALOG_DlgDirSelect( hDlg, lpString, nCount, nIDListBox, TRUE, FALSE );
2007 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1488
#define TRUE
Definition: types.h:120

◆ EndDialog()

BOOL WINAPI EndDialog ( HWND  hwnd,
INT_PTR  retval 
)

Definition at line 2015 of file dialog.c.

2018 {
2019  DIALOGINFO * dlgInfo;
2020  HWND owner;
2021  BOOL wasActive;
2022 
2023  TRACE("%p %ld\n", hwnd, retval );
2024 
2025  if (!(dlgInfo = GETDLGINFO(hwnd)))
2026  {
2027  ERR("got invalid window handle (%p); buggy app !?\n", hwnd);
2028  return FALSE;
2029  }
2030  wasActive = (hwnd == GetActiveWindow());
2031  dlgInfo->idResult = retval;
2032  dlgInfo->flags |= DF_END;
2033 
2035  {
2037  }
2038  else
2039  owner = GetWindow( hwnd, GW_OWNER );
2040 
2041  if (owner)
2042  EnableWindow( owner, TRUE );
2043 
2044  /* Windows sets the focus to the dialog itself in EndDialog */
2045 
2046  if (wasActive && IsChild(hwnd, GetFocus()))
2047  SetFocus( hwnd );
2048 
2049  /* Don't have to send a ShowWindow(SW_HIDE), just do
2050  SetWindowPos with SWP_HIDEWINDOW as done in Windows */
2051 
2052  SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE
2054 
2055  if (wasActive && owner)
2056  {
2057  /* If this dialog was given an owner then set the focus to that owner. */
2059  }
2060  else if (hwnd == GetActiveWindow()) // Check it again!
2061  {
2063  }
2064 
2065  /* unblock dialog loop */
2066  PostMessageA(hwnd, WM_NULL, 0, 0);
2067  return TRUE;
2068 }
#define WM_NULL
Definition: winuser.h:1589
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
#define TRUE
Definition: types.h:120
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WS_CHILD
Definition: pedump.c:617
#define SWP_NOZORDER
Definition: winuser.h:1232
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
#define SWP_HIDEWINDOW
Definition: winuser.h:1226
HWND WINAPI SetActiveWindow(_In_ HWND)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GA_PARENT
Definition: winuser.h:2742
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
INT idResult
Definition: dialog.c:56
#define SWP_NOACTIVATE
Definition: winuser.h:1227
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
UINT flags
Definition: dialog.c:57
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
Definition: simplecall.c:59
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SWP_NOSIZE
Definition: winuser.h:1230
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
#define WS_POPUP
Definition: pedump.c:616
#define GW_OWNER
Definition: winuser.h:761
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
HWND WINAPI GetFocus(void)
Definition: window.c:1875
#define DF_END
Definition: dialog.c:37
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138

Referenced by CongratsDlgProc(), custom_test_dialog_proc(), CustomDlgProc(), delayFocusDlgWinProc(), DIALOG_COPY_MOVE_DlgProc(), DIALOG_EXECUTE_DlgProc(), DIALOG_GoTo_DialogProc(), DIALOG_GROUP_DlgProc(), DIALOG_NEW_DlgProc(), DIALOG_PROGRAM_DlgProc(), DIALOG_SYMBOL_DlgProc(), disabled_test_proc(), DlgProc(), promptdisk_ok(), promptdisk_proc(), test_aw_conversion_dlgproc(), test_aw_conversion_dlgproc2(), test_aw_conversion_dlgproc3(), TestControlStyleDlgProc(), TestDefButtonDlgProc(), TestInitDialogHandleProc(), TestReturnKeyDlgProc(), timer_message_dlg_proc(), and TimesDlgProc().

◆ GetDialogBaseUnits()

LONG WINAPI GetDialogBaseUnits ( VOID  )

Definition at line 2076 of file dialog.c.

2077 {
2078  static DWORD units;
2079 
2080  if (!units)
2081  {
2082  HDC hdc;
2083  SIZE size;
2084 
2085  if ((hdc = GetDC(0)))
2086  {
2087  size.cx = GdiGetCharDimensions( hdc, NULL, &size.cy );
2088  if (size.cx) units = MAKELONG( size.cx, size.cy );
2089  ReleaseDC( 0, hdc );
2090  }
2091  }
2092  return units;
2093 }
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
HDC hdc
Definition: main.c:9
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
Definition: font.c:2145
GLfloat units
Definition: glext.h:11727

Referenced by CC_PaintCross(), CC_PaintTriangle(), DIALOG_CreateIndirect(), LoadDialog(), SoftModalMessageBox(), and test_menu_ownerdraw().

◆ GetDlgCtrlID()

int WINAPI GetDlgCtrlID ( HWND  hwndCtl)

Definition at line 2101 of file dialog.c.

2103 {
2104  return GetWindowLongPtrW( hwndCtl, GWLP_ID );
2105 }
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define GWLP_ID
Definition: winuser.h:854

Referenced by DEFDLG_Proc(), and IsDialogMessageW().

◆ GetDlgItem()

HWND WINAPI GetDlgItem ( HWND  hDlg,
int  nIDDlgItem 
)

Definition at line 2113 of file dialog.c.

2116 {
2117  int i;
2118  HWND *list;
2119  HWND ret = 0;
2120 
2121  if (!hDlg) return 0;
2122 
2123  list = WIN_ListChildren(hDlg);
2124  if (!list) return 0;
2125 
2126  for (i = 0; list[i]; i++) if (GetWindowLongPtrW(list[i], GWLP_ID) == nIDDlgItem) break;
2127  ret = list[i];
2128  HeapFree(GetProcessHeap(), 0, list);
2129 // if (!ret) SetLastError(ERROR_CONTROL_ID_NOT_FOUND);
2130  return ret;
2131 }
_In_ int nIDDlgItem
Definition: winuser.h:4488
#define GetWindowLongPtrW
Definition: winuser.h:4698
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define GetProcessHeap()
Definition: compat.h:395
int ret
Definition: _list.h:228
#define list
Definition: rosglue.h:35
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GWLP_ID
Definition: winuser.h:854

Referenced by DEFDLG_Proc(), DEFDLG_SetDefButton(), DEFDLG_SetDefId(), delayFocusDlgWinProc(), DIALOG_DlgDirListW(), DIALOG_DlgDirSelect(), DIALOG_EXECUTE_DlgProc(), DIALOG_FileSaveAs_Hook(), DIALOG_FixChildrenOnChangeFocus(), DIALOG_GoTo_DialogProc(), DIALOG_PROGRAM_DlgProc(), DIALOG_SYMBOL_DlgProc(), disabled_test_proc(), EnumConnectionsCallback(), focusDlgWinProc(), GetDlgItemTextA(), GetDlgItemTextW(), IsDialogMessageW(), LoadDialogCtrls(), msgbox_hook_proc(), OnCreate(), promptdisk_ok(), SendDlgItemMessageA(), SendDlgItemMessageW(), SetDlgItemTextA(), SetDlgItemTextW(), test_focus(), test_GetDlgItem(), TestControlStyleDlgProc(), TestReturnKeyDlgProc(), UpdateDialogLineSliderControl(), UpdateDialogLineSwitchControl(), and ValidateEditContents().

◆ GetDlgItemInt()

UINT WINAPI GetDlgItemInt ( HWND  hDlg,
int  nIDDlgItem,
BOOL lpTranslated,
BOOL  bSigned 
)

Definition at line 2139 of file dialog.c.

2144 {
2145  char str[30];
2146  char * endptr;
2147  LONG_PTR result = 0;
2148 
2149  if (lpTranslated) *lpTranslated = FALSE;
2150  if (!SendDlgItemMessageA(hDlg, nIDDlgItem, WM_GETTEXT, sizeof(str), (LPARAM)str))
2151  return 0;
2152  if (bSigned)
2153  {
2154  result = strtol( str, &endptr, 10 );
2155  if (!endptr || (endptr == str)) /* Conversion was unsuccessful */
2156  return 0;
2157  if (((result == LONG_MIN) || (result == LONG_MAX)))
2158  return 0;
2159  }
2160  else
2161  {
2162  result = strtoul( str, &endptr, 10 );
2163  if (!endptr || (endptr == str)) /* Conversion was unsuccessful */
2164  return 0;
2165  if (result == ULONG_MAX) return 0;
2166  }
2167  if (lpTranslated) *lpTranslated = TRUE;
2168  return (UINT)result;
2169 }
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
Definition: utclib.c:696
#define TRUE
Definition: types.h:120
#define WM_GETTEXT
Definition: winuser.h:1600
_In_ int nIDDlgItem
Definition: winuser.h:4488
const WCHAR * str
LONG_PTR LPARAM
Definition: windef.h:208
#define LONG_MAX
Definition: limits.h:43
LRESULT WINAPI SendDlgItemMessageA(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2680
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define LONG_MIN
Definition: limits.h:42
GLuint64EXT * result
Definition: glext.h:11304
#define ULONG_MAX
Definition: limits.h:44

Referenced by CustomDlgProc().

◆ GetDlgItemTextA()

UINT WINAPI GetDlgItemTextA ( HWND  hDlg,
int  nIDDlgItem,
LPSTR  lpString,
int  nMaxCount 
)

Definition at line 2177 of file dialog.c.

2182 {
2183  HWND hWnd = GetDlgItem(hDlg, nIDDlgItem);
2184  if ( hWnd ) return GetWindowTextA(hWnd, lpString, nMaxCount);
2185  if ( nMaxCount ) lpString[0] = '\0';
2186  return 0;
2187 }
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1296
HWND hWnd
Definition: settings.c:17
_In_ int nIDDlgItem
Definition: winuser.h:4488
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
_In_ int nMaxCount
Definition: winuser.h:4746

Referenced by AskTagProc(), COMDLG32_FR_HandleWMCommand(), CZipPassword::OnButton(), PRINTDLG_WMCommandA(), PRINTDLG_WMInitDialog(), and test_GetDlgItemText().

◆ GetDlgItemTextW()

UINT WINAPI GetDlgItemTextW ( HWND  hDlg,
int  nIDDlgItem,
LPWSTR  lpString,
int  nMaxCount 
)

Definition at line 2195 of file dialog.c.

2200 {
2201  HWND hWnd = GetDlgItem(hDlg, nIDDlgItem);
2202  if ( hWnd ) return GetWindowTextW(hWnd, lpString, nMaxCount);
2203  if ( nMaxCount ) lpString[0] = '\0';
2204  return 0;
2205 }
HWND hWnd
Definition: settings.c:17
_In_ int nIDDlgItem
Definition: winuser.h:4488
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
_In_ int nMaxCount
Definition: winuser.h:4746

Referenced by AddDlg_OnCommand(), CFn_WMCommand(), ComputerPageDlgProc(), CongratsDlgProc(), connections_on_notify(), CopyEventEntry(), CredDialogCommandOk(), BtrfsDeviceResize::DeviceResizeDlgProc(), DIALOG_EXECUTE_DlgProc(), DIALOG_GROUP_DlgProc(), DIALOG_PROGRAM_DlgProc(), DIALOG_SYMBOL_DlgProc(), dlgproc_addport(), dlgproc_lptconfig(), DoChangePassword(), EditActionDlg_OnOK(), EditDlg_OnCommand(), EditTypeDlg_OnOK(), FD31_StripEditControl(), FD31_Validate(), FinishDlgProc(), general_on_notify(), CDrvDefExt::GeneralPageProc(), CFileDefExt::GeneralPageProc(), get_dialog_font_point_size(), GetTextFromEdit(), GinaLoadFailedWindowProc(), COpenWithDialog::Init(), BtrfsPropSheet::init_propsheet(), CDrvDefExt::InitGeneralPage(), LoadHive_KeyNameInHookProc(), MainWindowProc(), margin_edit_notification(), MessageBoxTextToClipboard(), MoreOptDlgProc(), NetIDPage_OnApply(), NetworkDomainPageDlgProc(), NewActionDlg_OnOK(), NewExtDlg_OnOK(), CShellLink::OnNotify(), OwnerPageDlgProc(), PickIconProc(), PRINTDLG_WMCommandW(), PRINTDLG_WMInitDialogW(), PropSheetDlgProc(), BtrfsSend::SendDlgProc(), BtrfsPropSheet::set_size_on_disk(), BtrfsSend::StartSend(), BtrfsVolPropSheet::StatsDlgProc(), SummaryDlgProc(), BtrfsSend::Thread(), BtrfsPropSheet::update_size_details_dialog(), and WelcomeDlgProc().

◆ GetNextDlgGroupItem()

HWND WINAPI GetNextDlgGroupItem ( HWND  hDlg,
HWND  hCtl,
BOOL  bPrevious 
)

Definition at line 2212 of file dialog.c.

2216 {
2217  HWND hwnd, hwndNext, retvalue, hwndLastGroup = 0;
2218  BOOL fLooped=FALSE;
2219  BOOL fSkipping=FALSE;
2220 
2221  if (hDlg == hCtl) hCtl = NULL;
2222  if (!hCtl && bPrevious) return 0;
2223 
2224  /* if the hwndCtrl is the child of the control in the hwndDlg,
2225  * then the hwndDlg has to be the parent of the hwndCtrl */
2226 
2227  if (hCtl)
2228  {
2229  if (!IsChild (hDlg, hCtl)) return 0;
2230  /* Make sure hwndCtrl is a top-level child */
2231 
2232  }
2233  else
2234  {
2235  /* No ctrl specified -> start from the beginning */
2236  if (!(hCtl = GetWindow( hDlg, GW_CHILD ))) return 0;
2237  /* MSDN is wrong. fPrevious does not result in the last child */
2238 
2239  /* No ctrl specified -> start from the beginning */
2240  if (!(hCtl = GetWindow( hDlg, GW_CHILD ))) return 0;
2241 
2242  /* MSDN is wrong. fPrevious does not result in the last child */
2243 
2244  /* Maybe that first one is valid. If so then we don't want to skip it*/
2246  {
2247  return hCtl;
2248  }
2249 
2250  }
2251 
2252  /* Always go forward around the group and list of controls; for the
2253  * previous control keep track; for the next break when you find one
2254  */
2255  retvalue = hCtl;
2256  hwnd = hCtl;
2257  while (hwndNext = GetWindow (hwnd, GW_HWNDNEXT),
2258  1)
2259  {
2260  while (!hwndNext)
2261  {
2262  /* Climb out until there is a next sibling of the ancestor or we
2263  * reach the top (in which case we loop back to the start)
2264  */
2265  if (hDlg == GetParent (hwnd))
2266  {
2267  /* Wrap around to the beginning of the list, within the same
2268  * group. (Once only)
2269  */
2270  if (fLooped) goto end;
2271  fLooped = TRUE;
2272  hwndNext = GetWindow (hDlg, GW_CHILD);
2273  }
2274  else
2275  {
2276  hwnd = GetParent (hwnd);
2277  hwndNext = GetWindow (hwnd, GW_HWNDNEXT);
2278  }
2279  }
2280  hwnd = hwndNext;
2281 
2282  /* Wander down the leading edge of controlparents */
2285  (hwndNext = GetWindow (hwnd, GW_CHILD)))
2286  hwnd = hwndNext;
2287  /* Question. If the control is a control parent but either has no
2288  * children or is not visible/enabled then if it has a WS_GROUP does
2289  * it count? For that matter does it count anyway?
2290  * I believe it doesn't count.
2291  */
2292 
2294  {
2295  hwndLastGroup = hwnd;
2296  if (!fSkipping)
2297  {
2298  /* Look for the beginning of the group */
2299  fSkipping = TRUE;
2300  }
2301  }
2302 
2303  if (hwnd == hCtl)
2304  {
2305  if (!fSkipping) break;
2306  if (hwndLastGroup == hwnd) break;
2307  hwnd = hwndLastGroup;
2308  fSkipping = FALSE;
2309  fLooped = FALSE;
2310  }
2311 
2312  if (!fSkipping &&
2314  WS_VISIBLE)
2315  {
2316  retvalue = hwnd;
2317  if (!bPrevious) break;
2318  }
2319  }
2320 end:
2321  return retvalue;
2322 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define WS_GROUP
Definition: pedump.c:633
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define GW_CHILD
Definition: winuser.h:758
#define GWL_EXSTYLE
Definition: winuser.h:845
GLuint GLuint end
Definition: gl.h:1545
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GWL_STYLE
Definition: winuser.h:846
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:47
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by DEFDLG_RestoreFocus(), DIALOG_CreateIndirect(), IsDialogMessageW(), and test_GetNextDlgItem().

◆ GetNextDlgTabItem()

HWND WINAPI GetNextDlgTabItem ( HWND  hDlg,
HWND  hCtl,
BOOL  bPrevious 
)

Definition at line 2330 of file dialog.c.

2334 {
2335  PWND pWindow;
2336 
2337  pWindow = ValidateHwnd( hDlg );
2338  if (!pWindow) return NULL;
2339  if (hCtl)
2340  {
2341  pWindow = ValidateHwnd( hCtl );
2342  if (!pWindow) return NULL;
2343  }
2344 
2345  /* Undocumented but tested under Win2000 and WinME */
2346  if (hDlg == hCtl) hCtl = NULL;
2347 
2348  /* Contrary to MSDN documentation, tested under Win2000 and WinME
2349  * NB GetLastError returns whatever was set before the function was
2350  * called.
2351  */
2352  if (!hCtl && bPrevious) return 0;
2353 
2354  return DIALOG_GetNextTabItem(hDlg, hDlg, hCtl, bPrevious);
2355 }
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
Definition: ntuser.h:657
static HWND DIALOG_GetNextTabItem(HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious)
Definition: dialog.c:1312

Referenced by DEFDLG_Proc(), DEFDLG_RestoreFocus(), DIALOG_CreateIndirect(), dialog_setfocus(), IsDialogMessageW(), msi_mask_next_control(), test_GetNextDlgItem(), test_SaveRestoreFocus(), and TestInitDialogHandleProc().

◆ IsDialogMessageW()

BOOL WINAPI IsDialogMessageW ( HWND  hDlg,
LPMSG  lpMsg 
)

Definition at line 2471 of file dialog.c.

2474 {
2475  INT dlgCode = 0;
2476 
2477  if (!IsWindow( hDlg ))