ReactOS  0.4.15-dev-448-gd6c4411
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 GET_LONG(ptr)   (*(const LONG *)(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 45 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_LONG

#define GET_LONG (   ptr)    (*(const LONG *)(ptr))

Definition at line 44 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 2848 of file dialog.c.

2852 {
2853  SendDlgItemMessageW( hDlg, nIDButton, BM_SETCHECK, uCheck, 0 );
2854  return TRUE;
2855 }
#define TRUE
Definition: types.h:120
#define BM_SETCHECK
Definition: winuser.h:1903
LRESULT WINAPI SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2776

Referenced by DIALOG_EXECUTE_DlgProc(), and DIALOG_PROGRAM_DlgProc().

◆ CheckRadioButton()

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

Definition at line 2883 of file dialog.c.

2888 {
2889  RADIOGROUP radioGroup;
2890 
2891  radioGroup.firstID = nIDFirstButton;
2892  radioGroup.lastID = nIDLastButton;
2893  radioGroup.checkID = nIDCheckButton;
2894 
2895  return EnumChildWindows(hDlg, CheckRB, (LPARAM)&radioGroup);
2896 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
UINT lastID
Definition: dialog.c:103
LONG_PTR LPARAM
Definition: windef.h:208
UINT firstID
Definition: dialog.c:102
UINT checkID
Definition: dialog.c:104
static BOOL CALLBACK CheckRB(HWND hwnd, LPARAM lParam)
Definition: dialog.c:2857

Referenced by DIALOG_NEW_DlgProc().

◆ CheckRB()

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

Definition at line 2857 of file dialog.c.

2858 {
2859  LONG lChildID = GetWindowLongPtrW(hwnd, GWLP_ID);
2860  RADIOGROUP *lpRadioGroup = (RADIOGROUP *)lParam;
2861 
2862  if((lChildID >= lpRadioGroup->firstID) &&
2863  (lChildID <= lpRadioGroup->lastID))
2864  {
2865  if (lChildID == lpRadioGroup->checkID)
2866  {
2868  }
2869  else
2870  {
2872  }
2873  }
2874 
2875  return TRUE;
2876 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
UINT lastID
Definition: dialog.c:103
#define GetWindowLongPtrW
Definition: winuser.h:4804
long LONG
Definition: pedump.c:60
#define BM_SETCHECK
Definition: winuser.h:1903
#define BST_UNCHECKED
Definition: winuser.h:199
UINT firstID
Definition: dialog.c:102
UINT checkID
Definition: dialog.c:104
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 1645 of file dialog.c.

1651 {
1652  return CreateDialogIndirectParamAorW( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit, DLG_ISANSI);
1653 }
#define DLG_ISANSI
Definition: dialog.c:45
HINSTANCE hInstance
Definition: charmap.c:20
HWND WINAPI CreateDialogIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD Flags)
Definition: dialog.c:1623

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

◆ CreateDialogIndirectParamAorW()

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

Definition at line 1623 of file dialog.c.

1630 {
1631 /* FIXME:
1632  * This function might be obsolete since I don't think it is exported by NT
1633  * Also wine has one more parameter identifying weather it should call
1634  * the function with unicode or not
1635  */
1636  return DIALOG_CreateIndirect( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit , Flags == DLG_ISANSI ? FALSE : TRUE, NULL );
1637 }
#define TRUE
Definition: types.h:120
#define DLG_ISANSI
Definition: dialog.c:45
_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:774

Referenced by CreateDialogIndirectParamA(), and CreateDialogIndirectParamW().

◆ CreateDialogIndirectParamW()

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

Definition at line 1661 of file dialog.c.

1667 {
1668  return CreateDialogIndirectParamAorW( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit, 0);
1669 }
HINSTANCE hInstance
Definition: charmap.c:20
HWND WINAPI CreateDialogIndirectParamAorW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD Flags)
Definition: dialog.c:1623

Referenced by CreateDialogParamW(), and test_MessageBoxFontTest().

◆ CreateDialogParamA()

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

Definition at line 1677 of file dialog.c.

1683 {
1684  HRSRC hrsrc;
1686 
1687  if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG ))) return 0;
1688  if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
1689  return CreateDialogIndirectParamA( hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam );
1690 }
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:1645
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 1698 of file dialog.c.

1704 {
1705  HRSRC hrsrc;
1707 
1708  if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG ))) return 0;
1709  if (!(ptr = (LPCDLGTEMPLATE)LoadResource(hInstance, hrsrc))) return 0;
1710  return CreateDialogIndirectParamW( hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam );
1711 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HWND WINAPI CreateDialogIndirectParamW(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
Definition: dialog.c:1661
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 1352 of file dialog.c.

1353 {
1354  if ((msg >= WM_CTLCOLORMSGBOX && msg <= WM_CTLCOLORSTATIC) ||
1355  msg == WM_CTLCOLOR)
1356  {
1357  if (fResult) return fResult;
1358 
1359  return fAnsi ? DefWindowProcA(hwnd, msg, wParam, lParam):
1361  }
1362  if ( msg == WM_COMPAREITEM ||
1363  msg == WM_VKEYTOITEM || msg == WM_CHARTOITEM ||
1365  return fResult;
1366 
1368 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
#define WM_CTLCOLOR
Definition: windowsx.h:4
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:1748
#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:1721
LPARAM lParam
Definition: combotst.c:139

Referenced by DefDlgProcA(), and DefDlgProcW().

◆ DEFDLG_FindDefButton()

static HWND DEFDLG_FindDefButton ( HWND  hwndDlg)
static

Definition at line 1094 of file dialog.c.

1095 {
1096  HWND hwndChild, hwndTmp;
1097 
1098  hwndChild = GetWindow( hwndDlg, GW_CHILD );
1099  while (hwndChild)
1100  {
1101  if (SendMessageW( hwndChild, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
1102  break;
1103 
1104  /* Recurse into WS_EX_CONTROLPARENT controls */
1106  {
1107  LONG dsStyle = GetWindowLongPtrW( hwndChild, GWL_STYLE );
1108  if ((dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED) &&
1109  (hwndTmp = DEFDLG_FindDefButton(hwndChild)) != NULL)
1110  return hwndTmp;
1111  }
1112  hwndChild = GetWindow( hwndChild, GW_HWNDNEXT );
1113  }
1114  return hwndChild;
1115 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define WS_DISABLED
Definition: pedump.c:621
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1094
#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:4804
#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:2590
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 1241 of file dialog.c.

1243 {
1244  switch(msg)
1245  {
1246  case WM_ERASEBKGND:
1247  {
1248  HBRUSH brush = GetControlColor( hwnd, hwnd, (HDC)wParam, WM_CTLCOLORDLG);
1249  if (brush)
1250  {
1251  RECT rect;
1252  HDC hdc = (HDC)wParam;
1253  GetClientRect( hwnd, &rect );
1254  DPtoLP( hdc, (LPPOINT)&rect, 2 );
1255  FillRect( hdc, &rect, brush );
1256  }
1257  return 1;
1258  }
1259  case WM_NCDESTROY:
1261  if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 )))
1262  {
1263  if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
1264  if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
1265  HeapFree( GetProcessHeap(), 0, dlgInfo );
1268  }
1269  /* Window clean-up */
1270  return DefWindowProcA( hwnd, msg, wParam, lParam );
1271 
1272  case WM_SHOWWINDOW:
1273  if (!wParam) DEFDLG_SaveFocus( hwnd );
1274  return DefWindowProcA( hwnd, msg, wParam, lParam );
1275 
1276  case WM_ACTIVATE:
1277  { // ReactOS
1278  DWORD dwSetFlag;
1280  // if WA_CLICK/ACTIVE ? set dialog is active.
1281  dwSetFlag = wParam ? DF_DIALOGACTIVE : 0;
1283  }
1285  else DEFDLG_SaveFocus( hwnd );
1286  return 0;
1287 
1288  case WM_SETFOCUS:
1290  return 0;
1291 
1292  case DM_SETDEFID:
1293  if (dlgInfo && !(dlgInfo->flags & DF_END))
1294  DEFDLG_SetDefId( hwnd, dlgInfo, wParam );
1295  return 1;
1296 
1297  case DM_GETDEFID:
1298  if (dlgInfo && !(dlgInfo->flags & DF_END))
1299  {
1300  HWND hwndDefId;
1301  if (dlgInfo->idResult)
1302  return MAKELONG( dlgInfo->idResult, DC_HASDEFID );
1303  if ((hwndDefId = DEFDLG_FindDefButton( hwnd )))
1304  return MAKELONG( GetDlgCtrlID( hwndDefId ), DC_HASDEFID);
1305  }
1306  return 0;
1307 
1308 #ifdef __REACTOS__
1309  case DM_REPOSITION:
1310  DEFDLG_Reposition(hwnd);
1311  return 0;
1312 #endif
1313  case WM_NEXTDLGCTL:
1314  if (dlgInfo)
1315  {
1316  HWND hwndDest = (HWND)wParam;
1317  if (!lParam)
1318  hwndDest = GetNextDlgTabItem(hwnd, GetFocus(), wParam);
1319  if (hwndDest) DEFDLG_SetFocus( hwndDest );
1320  DEFDLG_SetDefButton( hwnd, dlgInfo, hwndDest );
1321  }
1322  return 0;
1323 
1324  case WM_ENTERMENULOOP:
1325  case WM_LBUTTONDOWN:
1326  case WM_NCLBUTTONDOWN:
1327  {
1328  HWND hwndFocus = GetFocus();
1329  if (hwndFocus)
1330  {
1331  /* always make combo box hide its listbox control */
1332  if (!SendMessageW( hwndFocus, CB_SHOWDROPDOWN, FALSE, 0 ))
1333  SendMessageW( GetParent(hwndFocus), CB_SHOWDROPDOWN, FALSE, 0 );
1334  }
1335  }
1336  return DefWindowProcA( hwnd, msg, wParam, lParam );
1337 
1338  case WM_GETFONT:
1339  return dlgInfo ? (LRESULT)dlgInfo->hUserFont : 0;
1340 
1341  case WM_CLOSE:
1343  (LPARAM)GetDlgItem( hwnd, IDCANCEL ) );
1344  return 0;
1345  }
1346  return 0;
1347 }
#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:2406
static HWND hwndparent
Definition: listview.c:56
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1094
static void DEFDLG_SetFocus(HWND hwndCtrl)
Definition: dialog.c:714
static void DEFDLG_RestoreFocus(HWND hwnd, BOOL justActivate)
Definition: dialog.c:740
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#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:1752
static BOOL DEFDLG_SetDefButton(HWND hwndDlg, DIALOGINFO *dlgInfo, HWND hwndNew)
Definition: dialog.c:1156
static HDC
Definition: imagelist.c:92
static BOOL DEFDLG_SetDefId(HWND hwndDlg, DIALOGINFO *dlgInfo, WPARAM wParam)
Definition: dialog.c:1123
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:2081
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:2080
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:145
HFONT hUserFont
Definition: dialog.c:53
#define CB_SHOWDROPDOWN
Definition: winuser.h:1952
#define DC_HASDEFID
Definition: winuser.h:2584
#define WM_ENTERMENULOOP
Definition: winuser.h:1786
#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:404
INT idResult
Definition: dialog.c:57
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
#define BN_CLICKED
Definition: winuser.h:1907
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD NTAPI NtUserSetThreadState(DWORD Unknown0, DWORD Unknown1)
Definition: misc.c:327
#define DM_REPOSITION
Definition: winuser.h:2082
HDC hdc
Definition: main.c:9
static HWND DIALOG_FindMsgDestination(HWND hwndDlg)
Definition: dialog.c:476
#define LRESULT
Definition: ole.h:14
#define WM_COMMAND
Definition: winuser.h:1722
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT flags
Definition: dialog.c:58
BOOL WINAPI DestroyMenu(_In_ HMENU)
int WINAPI GetDlgCtrlID(HWND hwndCtl)
Definition: dialog.c:2177
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:54
HWND WINAPI GetFocus(void)
Definition: window.c:1909
#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:2189
#define SetWindowLongPtrW
Definition: winuser.h:5321
#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:403
static void DEFDLG_SaveFocus(HWND hwnd)
Definition: dialog.c:725

Referenced by DefDlgProcA(), and DefDlgProcW().

◆ DEFDLG_RestoreFocus()

static void DEFDLG_RestoreFocus ( HWND  hwnd,
BOOL  justActivate 
)
static

Definition at line 740 of file dialog.c.

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

Referenced by DEFDLG_Proc().

◆ DEFDLG_SaveFocus()

static void DEFDLG_SaveFocus ( HWND  hwnd)
static

Definition at line 725 of file dialog.c.

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

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 1156 of file dialog.c.

1157 {
1158  DWORD dlgcode=0; /* initialize just to avoid a warning */
1159  HWND hwndOld = GetDlgItem( hwndDlg, dlgInfo->idResult );
1160 
1161  if (hwndNew &&
1162  !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ))
1164  {
1170  hwndNew = hwndOld;
1171  dlgcode = SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 );
1172  }
1173 
1174  /* Make sure the old default control is a valid push button ID */
1175  if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
1176  hwndOld = DEFDLG_FindDefButton( hwndDlg );
1177  if (hwndOld && hwndOld != hwndNew)
1179 
1180  if (hwndNew)
1181  {
1182  if(dlgcode & DLGC_UNDEFPUSHBUTTON)
1184  }
1185  return TRUE;
1186 }
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2591
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1094
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define BM_SETSTYLE
Definition: winuser.h:1906
INT idResult
Definition: dialog.c:57
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:2189

Referenced by DEFDLG_Proc().

◆ DEFDLG_SetDefId()

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

Definition at line 1123 of file dialog.c.

1124 {
1125  DWORD dlgcode=0; /* initialize just to avoid a warning */
1126  HWND hwndOld, hwndNew = GetDlgItem(hwndDlg, wParam);
1127  INT old_id = dlgInfo->idResult;
1128 
1129  dlgInfo->idResult = wParam;
1130  if (hwndNew &&
1131  !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 ))
1133  return FALSE; /* Destination is not a push button */
1134 
1135  /* Make sure the old default control is a valid push button ID */
1136  hwndOld = GetDlgItem( hwndDlg, old_id );
1137  if (!hwndOld || !(SendMessageW( hwndOld, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON))
1138  hwndOld = DEFDLG_FindDefButton( hwndDlg );
1139  if (hwndOld && hwndOld != hwndNew)
1141 
1142  if (hwndNew)
1143  {
1144  if(dlgcode & DLGC_UNDEFPUSHBUTTON)
1146  }
1147  return TRUE;
1148 }
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2591
static HWND DEFDLG_FindDefButton(HWND hwndDlg)
Definition: dialog.c:1094
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
int32_t INT
Definition: typedefs.h:57
WPARAM wParam
Definition: combotst.c:138
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define BM_SETSTYLE
Definition: winuser.h:1906
INT idResult
Definition: dialog.c:57
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define DLGC_BUTTON
Definition: winuser.h:2595
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189

Referenced by DEFDLG_Proc().

◆ DEFDLG_SetFocus()

static void DEFDLG_SetFocus ( HWND  hwndCtrl)
static

Definition at line 714 of file dialog.c.

715 {
716  if (SendMessageW( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
717  SendMessageW( hwndCtrl, EM_SETSEL, 0, -1 );
718  SetFocus( hwndCtrl );
719 }
#define WM_GETDLGCODE
Definition: winuser.h:1671
HWND WINAPI SetFocus(_In_opt_ HWND)
#define DLGC_HASSETSEL
Definition: winuser.h:2589
#define EM_SETSEL
Definition: winuser.h:2000
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 1719 of file dialog.c.

1724 {
1725  DIALOGINFO *dlgInfo;
1726  WNDPROC dlgproc;
1727  BOOL result = FALSE;
1728 
1729  /* Perform DIALOGINFO initialization if not done */
1730  if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
1731 
1732  SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
1733 
1734  if ((dlgproc = (WNDPROC)GetWindowLongPtrW( hDlg, DWLP_DLGPROC )))
1735  {
1736  /* Call dialog procedure */
1737  result = CallWindowProcA( dlgproc, hDlg, Msg, wParam, lParam );
1738  }
1739 
1740  if (!result && IsWindow(hDlg))
1741  {
1742  /* callback didn't process this message */
1743 
1744  switch(Msg)
1745  {
1746  case WM_ERASEBKGND:
1747  case WM_SHOWWINDOW:
1748  case WM_ACTIVATE:
1749  case WM_SETFOCUS:
1750  case DM_SETDEFID:
1751  case DM_GETDEFID:
1752 #ifdef __REACTOS__
1753  case DM_REPOSITION:
1754 #endif
1755  case WM_NEXTDLGCTL:
1756  case WM_GETFONT:
1757  case WM_CLOSE:
1758  case WM_NCDESTROY:
1759  case WM_ENTERMENULOOP:
1760  case WM_LBUTTONDOWN:
1761  case WM_NCLBUTTONDOWN:
1762  return DEFDLG_Proc( hDlg, Msg, wParam, lParam, dlgInfo );
1763  case WM_INITDIALOG:
1764  case WM_VKEYTOITEM:
1765  case WM_COMPAREITEM:
1766  case WM_CHARTOITEM:
1767  break;
1768 
1769  default:
1770  return DefWindowProcA( hDlg, Msg, wParam, lParam );
1771  }
1772  }
1773  return DEFDLG_Epilog(hDlg, Msg, wParam, lParam, result, TRUE);
1774 }
struct @1608 Msg[]
#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:1758
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
BOOL WINAPI IsWindow(_In_opt_ HWND)
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:133
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define DM_SETDEFID
Definition: winuser.h:2081
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:2080
#define WM_CHARTOITEM
Definition: winuser.h:1631
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_ENTERMENULOOP
Definition: winuser.h:1786
#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
#define DM_REPOSITION
Definition: winuser.h:2082
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#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:1352
#define SetWindowLongPtrW
Definition: winuser.h:5321
static LRESULT DEFDLG_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, DIALOGINFO *dlgInfo)
Definition: dialog.c:1241
#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:1721
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 1782 of file dialog.c.

1787 {
1788  DIALOGINFO *dlgInfo;
1789  WNDPROC dlgproc;
1790  BOOL result = FALSE;
1791 
1792  /* Perform DIALOGINFO initialization if not done */
1793  if(!(dlgInfo = DIALOG_get_info( hDlg, TRUE ))) return 0;
1794 
1795  SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
1796 
1797  if ((dlgproc = (WNDPROC)GetWindowLongPtrW( hDlg, DWLP_DLGPROC )))
1798  {
1799  /* Call dialog procedure */
1800  result = CallWindowProcW( dlgproc, hDlg, Msg, wParam, lParam );
1801  }
1802 
1803  if (!result && IsWindow(hDlg))
1804  {
1805  /* callback didn't process this message */
1806 
1807  switch(Msg)
1808  {
1809  case WM_ERASEBKGND:
1810  case WM_SHOWWINDOW:
1811  case WM_ACTIVATE:
1812  case WM_SETFOCUS:
1813  case DM_SETDEFID:
1814  case DM_GETDEFID:
1815 #ifdef __REACTOS__
1816  case DM_REPOSITION:
1817 #endif
1818  case WM_NEXTDLGCTL:
1819  case WM_GETFONT:
1820  case WM_CLOSE:
1821  case WM_NCDESTROY:
1822  case WM_ENTERMENULOOP:
1823  case WM_LBUTTONDOWN:
1824  case WM_NCLBUTTONDOWN:
1825  return DEFDLG_Proc( hDlg, Msg, wParam, lParam, dlgInfo );
1826  case WM_INITDIALOG:
1827  case WM_VKEYTOITEM:
1828  case WM_COMPAREITEM:
1829  case WM_CHARTOITEM:
1830  break;
1831 
1832  default:
1833  return DefWindowProcW( hDlg, Msg, wParam, lParam );
1834  }
1835  }
1836  return DEFDLG_Epilog(hDlg, Msg, wParam, lParam, result, FALSE);
1837 }
struct @1608 Msg[]
#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:1758
#define WM_NEXTDLGCTL
Definition: winuser.h:1625
BOOL WINAPI IsWindow(_In_opt_ HWND)
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:133
#define WM_SHOWWINDOW
Definition: winuser.h:1610
#define DM_SETDEFID
Definition: winuser.h:2081
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:2080
#define WM_CHARTOITEM
Definition: winuser.h:1631
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_ENTERMENULOOP
Definition: winuser.h:1786
#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
#define DM_REPOSITION
Definition: winuser.h:2082
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#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:1352
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SetWindowLongPtrW
Definition: winuser.h:5321
static LRESULT DEFDLG_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, DIALOGINFO *dlgInfo)
Definition: dialog.c:1241
#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:1721
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 287 of file dialog.c.

289 {
290  DIALOGINFO * dlgInfo;
292  HWND hwndCtrl, hwndDefButton = 0;
293  INT items = dlgTemplate->nbItems;
294 
295  if (!(dlgInfo = GETDLGINFO(hwnd))) return FALSE;
296 
297  TRACE(" BEGIN\n" );
298  while (items--)
299  {
300  template = (LPCSTR)DIALOG_GetControl32( (const WORD *)template, &info,
301  dlgTemplate->dialogEx );
302  info.style &= ~WS_POPUP;
303  info.style |= WS_CHILD;
304 
305  if (info.style & WS_BORDER)
306  {
307  info.style &= ~WS_BORDER;
308  info.exStyle |= WS_EX_CLIENTEDGE;
309  }
310 
311  if (unicode)
312  {
313  hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
314  info.className, info.windowName,
315  info.style | WS_CHILD,
316  MulDiv(info.x, dlgInfo->xBaseUnit, 4),
317  MulDiv(info.y, dlgInfo->yBaseUnit, 8),
318  MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
319  MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
320  hwnd, (HMENU)(ULONG_PTR)info.id,
321  hInst, (LPVOID)info.data );
322  }
323  else
324  {
325  LPSTR class = (LPSTR)info.className;
326  LPSTR caption = (LPSTR)info.windowName;
327 
328  if (!IS_INTRESOURCE(class))
329  {
330  DWORD len = WideCharToMultiByte( CP_ACP, 0, info.className, -1, NULL, 0, NULL, NULL );
331  class = HeapAlloc( GetProcessHeap(), 0, len );
332  if (class != NULL)
333  WideCharToMultiByte( CP_ACP, 0, info.className, -1, class, len, NULL, NULL );
334  }
335  if (!IS_INTRESOURCE(caption))
336  {
337  DWORD len = WideCharToMultiByte( CP_ACP, 0, info.windowName, -1, NULL, 0, NULL, NULL );
338  caption = HeapAlloc( GetProcessHeap(), 0, len );
339  if (caption != NULL)
340  WideCharToMultiByte( CP_ACP, 0, info.windowName, -1, caption, len, NULL, NULL );
341  }
342 
343  if (class != NULL && caption != NULL)
344  {
345  hwndCtrl = CreateWindowExA( info.exStyle | WS_EX_NOPARENTNOTIFY,
346  class, caption, info.style | WS_CHILD,
347  MulDiv(info.x, dlgInfo->xBaseUnit, 4),
348  MulDiv(info.y, dlgInfo->yBaseUnit, 8),
349  MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
350  MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
351  hwnd, (HMENU)(ULONG_PTR)info.id,
352  hInst, (LPVOID)info.data );
353  }
354  else
355  hwndCtrl = NULL;
356  if (!IS_INTRESOURCE(class)) HeapFree( GetProcessHeap(), 0, class );
358  }
359 
360  if (info.windowNameFree)
361  {
362  HeapFree( GetProcessHeap(), 0, (LPVOID)info.windowName );
363  }
364 
365  if (!hwndCtrl)
366  {
367  WARN("control %s %s creation failed\n", debugstr_w(info.className),
368  debugstr_w(info.windowName));
369  if (dlgTemplate->style & DS_NOFAILCREATE) continue;
370  return FALSE;
371  }
372 
373  /* Send initialisation messages to the control */
374  if (dlgInfo->hUserFont) SendMessageW( hwndCtrl, WM_SETFONT,
375  (WPARAM)dlgInfo->hUserFont, 0 );
376  if (SendMessageW(hwndCtrl, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
377  {
378  /* If there's already a default push-button, set it back */
379  /* to normal and use this one instead. */
380  if (hwndDefButton)
381  SendMessageW( hwndDefButton, BM_SETSTYLE, BS_PUSHBUTTON, FALSE );
382  hwndDefButton = hwndCtrl;
383  dlgInfo->idResult = GetWindowLongPtrA( hwndCtrl, GWLP_ID );
384  }
385  }
386  TRACE(" END\n" );
387  return TRUE;
388 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD nbItems
Definition: dialog.c:84
static const WORD * DIALOG_GetControl32(const WORD *p, DLG_CONTROL_INFO *info, BOOL dialogEx)
Definition: dialog.c:178
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WideCharToMultiByte
Definition: compat.h:101
char caption[64]
Definition: dialog.c:2334
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:112
#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:57
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t ULONG_PTR
Definition: typedefs.h:64
HFONT hUserFont
Definition: dialog.c:53
#define debugstr_w
Definition: kernel32.h:32
UINT yBaseUnit
Definition: dialog.c:56
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
#define GetWindowLongPtrA
Definition: winuser.h:4803
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define BM_SETSTYLE
Definition: winuser.h:1906
INT idResult
Definition: dialog.c:57
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL dialogEx
Definition: dialog.c:96
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:81
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:55
#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:403
#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 774 of file dialog.c.

777 {
778  HWND hwnd;
779  RECT rect;
780  POINT pos;
781  SIZE size;
782  DLG_TEMPLATE template;
783  DIALOGINFO * dlgInfo = NULL;
785  HWND disabled_owner = NULL;
786  HMENU hMenu = 0;
787  HFONT hUserFont = 0;
788  UINT flags = 0;
789  UINT xBaseUnit = LOWORD(units);
790  UINT yBaseUnit = HIWORD(units);
791 
792  /* Parse dialog template */
793 
794  if (!dlgTemplate) return 0;
795  dlgTemplate = DIALOG_ParseTemplate32( dlgTemplate, &template );
796 
797  /* Load menu */
798 
799  if (template.menuName) hMenu = LoadMenuW( hInst, template.menuName );
800 
801  /* Create custom font if needed */
802 
803  if (template.style & DS_SETFONT)
804  {
805  HDC dc = GetDC(0);
806 
807  if (template.pointSize == 0x7fff)
808  {
809  /* We get the message font from the non-client metrics */
810  NONCLIENTMETRICSW ncMetrics;
811 
812  ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW);
813  if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,
814  sizeof(NONCLIENTMETRICSW), &ncMetrics, 0))
815  {
816  hUserFont = CreateFontIndirectW( &ncMetrics.lfMessageFont );
817  }
818  }
819  else
820  {
821  /* We convert the size to pixels and then make it -ve. This works
822  * for both +ve and -ve template.pointSize */
823  int pixels = MulDiv(template.pointSize, GetDeviceCaps(dc , LOGPIXELSY), 72);
824  hUserFont = CreateFontW( -pixels, 0, 0, 0, template.weight,
825  template.italic, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
827  template.faceName );
828  }
829 
830  if (hUserFont)
831  {
832  SIZE charSize;
833  HFONT hOldFont = SelectObject( dc, hUserFont );
834  charSize.cx = GdiGetCharDimensions( dc, NULL, &charSize.cy );
835  if (charSize.cx)
836  {
837  xBaseUnit = charSize.cx;
838  yBaseUnit = charSize.cy;
839  }
840  SelectObject( dc, hOldFont );
841  }
842  ReleaseDC(0, dc);
843  TRACE("units = %d,%d\n", xBaseUnit, yBaseUnit );
844  }
845 
846  /* Create dialog main window */
847 
848  SetRect(&rect, 0, 0, MulDiv(template.cx, xBaseUnit, 4), MulDiv(template.cy, yBaseUnit, 8));
849  if (template.style & DS_CONTROL)
850  template.style &= ~(WS_CAPTION|WS_SYSMENU);
851  template.style |= DS_3DLOOK;
852  if (template.style & DS_MODALFRAME)
853  template.exStyle |= WS_EX_DLGMODALFRAME;
854  if ((template.style & DS_CONTROL) || !(template.style & WS_CHILD))
855  template.exStyle |= WS_EX_CONTROLPARENT;
856  AdjustWindowRectEx( &rect, template.style, (hMenu != 0), template.exStyle );
857  pos.x = rect.left;
858  pos.y = rect.top;
859  size.cx = rect.right - rect.left;
860  size.cy = rect.bottom - rect.top;
861 
862  if (template.x == CW_USEDEFAULT16)
863  {
864  pos.x = pos.y = CW_USEDEFAULT;
865  }
866  else
867  {
868  HMONITOR monitor = 0;
869  MONITORINFO mon_info;
870 
871  mon_info.cbSize = sizeof(mon_info);
872  if (template.style & DS_CENTER)
873  {
874  monitor = MonitorFromWindow( owner ? owner : GetActiveWindow(), MONITOR_DEFAULTTOPRIMARY );
875  GetMonitorInfoW( monitor, &mon_info );
876  pos.x = (mon_info.rcWork.left + mon_info.rcWork.right - size.cx) / 2;
877  pos.y = (mon_info.rcWork.top + mon_info.rcWork.bottom - size.cy) / 2;
878  }
879  else if (template.style & DS_CENTERMOUSE)
880  {
881  GetCursorPos( &pos );
882  monitor = MonitorFromPoint( pos, MONITOR_DEFAULTTOPRIMARY );
883  GetMonitorInfoW( monitor, &mon_info );
884  }
885  else
886  {
887  pos.x += MulDiv(template.x, xBaseUnit, 4);
888  pos.y += MulDiv(template.y, yBaseUnit, 8);
889  //
890  // REACTOS : Need an owner to be passed!!!
891  //
892  if (!(template.style & (WS_CHILD|DS_ABSALIGN)) && owner ) ClientToScreen( owner, &pos );
893  }
894  if ( !(template.style & WS_CHILD) )
895  {
896  INT dX, dY;
897 
898  /* try to fit it into the desktop */
899 
900  if (!monitor)
901  {
902  SetRect( &rect, pos.x, pos.y, pos.x + size.cx, pos.y + size.cy );
903  monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
904  GetMonitorInfoW( monitor, &mon_info );
905  }
906  if ((dX = pos.x + size.cx + GetSystemMetrics(SM_CXDLGFRAME) - mon_info.rcWork.right) > 0)
907  pos.x -= dX;
908  if ((dY = pos.y + size.cy + GetSystemMetrics(SM_CYDLGFRAME) - mon_info.rcWork.bottom) > 0)
909  pos.y -= dY;
910  if( pos.x < mon_info.rcWork.left ) pos.x = mon_info.rcWork.left;
911  if( pos.y < mon_info.rcWork.top ) pos.y = mon_info.rcWork.top;
912  }
913  }
914 
915  if (modal_owner && owner)
916  {
917  HWND parent = NULL;
918  /*
919  * Owner needs to be top level window. We need to duplicate the logic from server,
920  * because we need to disable it before creating dialog window. Note that we do that
921  * even if dialog has WS_CHILD, but only for modal dialogs, which matched what
922  * Windows does.
923  */
925  {
926  parent = GetParent( owner );
927  if (!parent || parent == GetDesktopWindow()) break;
928  owner = parent;
929  }
931  if (!parent) parent = GetAncestor( owner, GA_ROOT );
932 
933  if (parent)
934  {
935  owner = parent;
936 
937  if (IsWindowEnabled( owner ))
938  {
939  HWND captured = NULL;
940  disabled_owner = owner;
941  EnableWindow( disabled_owner, FALSE );
942 
943  captured = GetCapture();
944 
945  if (captured)
946  SendMessageW(captured, WM_CANCELMODE, 0, 0);
947  }
948  }
949  *modal_owner = owner;
950  }
951 
952  if (unicode)
953  {
954  hwnd = CreateWindowExW(template.exStyle, template.className, template.caption,
955  template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy,
956  owner, hMenu, hInst, NULL );
957  }
958  else
959  {
960  LPCSTR class = (LPCSTR)template.className;
961  LPCSTR caption = (LPCSTR)template.caption;
962  LPSTR class_tmp = NULL;
963  LPSTR caption_tmp = NULL;
964 
965  if (!IS_INTRESOURCE(class))
966  {
967  DWORD len = WideCharToMultiByte( CP_ACP, 0, template.className, -1, NULL, 0, NULL, NULL );
968  class_tmp = HeapAlloc( GetProcessHeap(), 0, len );
969  WideCharToMultiByte( CP_ACP, 0, template.className, -1, class_tmp, len, NULL, NULL );
970  class = class_tmp;
971  }
972  if (!IS_INTRESOURCE(caption))
973  {
974  DWORD len = WideCharToMultiByte( CP_ACP, 0, template.caption, -1, NULL, 0, NULL, NULL );
975  caption_tmp = HeapAlloc( GetProcessHeap(), 0, len );
976  WideCharToMultiByte( CP_ACP, 0, template.caption, -1, caption_tmp, len, NULL, NULL );
977  caption = caption_tmp;
978  }
979  hwnd = CreateWindowExA(template.exStyle, class, caption,
980  template.style & ~WS_VISIBLE, pos.x, pos.y, size.cx, size.cy,
981  owner, hMenu, hInst, NULL );
982  HeapFree( GetProcessHeap(), 0, class_tmp );
983  HeapFree( GetProcessHeap(), 0, caption_tmp );
984  }
985 
986  if (!hwnd)
987  {
988  if (hUserFont) DeleteObject( hUserFont );
989  if (hMenu) DestroyMenu( hMenu );
990  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
991  return 0;
992  }
993 
994  /* moved this from the top of the method to here as DIALOGINFO structure
995  will be valid only after WM_CREATE message has been handled in DefDlgProc
996  All the members of the structure get filled here using temp variables */
997  dlgInfo = DIALOG_get_info( hwnd, TRUE );
998  // ReactOS
999  if (dlgInfo == NULL)
1000  {
1001  if (hUserFont) DeleteObject( hUserFont );
1002  if (hMenu) DestroyMenu( hMenu );
1003  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
1004  return 0;
1005  }
1006  //
1007  dlgInfo->hwndFocus = 0;
1008  dlgInfo->hUserFont = hUserFont;
1009  dlgInfo->hMenu = hMenu;
1010  dlgInfo->xBaseUnit = xBaseUnit;
1011  dlgInfo->yBaseUnit = yBaseUnit;
1012  dlgInfo->flags = flags;
1013 
1014  if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
1015 
1016  if (unicode) SetWindowLongPtrW( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
1017  else SetWindowLongPtrA( hwnd, DWLP_DLGPROC, (ULONG_PTR)dlgProc );
1018 
1019  if (dlgProc && dlgInfo->hUserFont)
1020  SendMessageW( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
1021 
1022  /* Create controls */
1023 
1024  if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
1025  {
1026  /* Send initialisation messages and set focus */
1027 
1028  if (dlgProc)
1029  {
1030  HWND focus = GetNextDlgTabItem( hwnd, 0, FALSE );
1031  if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
1032  if (SendMessageW( hwnd, WM_INITDIALOG, (WPARAM)focus, param ) && IsWindow( hwnd ) &&
1033  ((~template.style & DS_CONTROL) || (template.style & WS_VISIBLE)))
1034  {
1035  /* By returning TRUE, app has requested a default focus assignment.
1036  * WM_INITDIALOG may have changed the tab order, so find the first
1037  * tabstop control again. */
1038  focus = GetNextDlgTabItem( hwnd, 0, FALSE );
1039  if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE );
1040  if (focus)
1041  {
1042  if (SendMessageW( focus, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
1043  SendMessageW( focus, EM_SETSEL, 0, MAXLONG );
1044  SetFocus( focus );
1045  }
1046  else
1047  {
1048  if (!(template.style & WS_CHILD))
1049  SetFocus( hwnd );
1050  }
1051  }
1054  //DEFDLG_SaveFocus( hwnd );
1056  }
1059  SendMessageW( hwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0);
1061  if (template.style & WS_VISIBLE && !(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_VISIBLE))
1062  {
1063  ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
1064  UpdateWindow( hwnd );
1065  IntNotifyWinEvent(EVENT_SYSTEM_DIALOGSTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
1066  }
1067  return hwnd;
1068  }
1069  if (disabled_owner) EnableWindow( disabled_owner, TRUE );
1070  IntNotifyWinEvent(EVENT_SYSTEM_DIALOGEND, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
1071  if( IsWindow(hwnd) )
1072  {
1073  DestroyWindow( hwnd );
1075  if (owner)
1076  { ERR("DIALOG_CreateIndirect 1\n");
1079  { ERR("DIALOG_CreateIndirect SFW\n");
1081  }
1082  }
1084  }
1085  return 0;
1086 }
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define GA_ROOT
Definition: winuser.h:2764
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:2406
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
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:2334
#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:584
#define OBJID_WINDOW
Definition: winable.h:15
DIALOGINFO * DIALOG_get_info(HWND hWnd, BOOL create)
Definition: dialog.c:133
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CW_USEDEFAULT16
Definition: undocuser.h:167
#define DS_CENTER
Definition: winuser.h:369
LONG top
Definition: windef.h:307
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)
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define GetWindowLongPtrW
Definition: winuser.h:4804
LONG left
Definition: windef.h:306
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:308
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PROOF_QUALITY
Definition: wingdi.h:437
int32_t INT
Definition: typedefs.h:57
#define DLGC_HASSETSEL
Definition: winuser.h:2589
& rect
Definition: startmenu.cpp:1413
uint32_t ULONG_PTR
Definition: typedefs.h:64
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
#define DS_MODALFRAME
Definition: winuser.h:375
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
HFONT hUserFont
Definition: dialog.c:53
#define SM_CYDLGFRAME
Definition: winuser.h:958
HWND WINAPI GetCapture(void)
Definition: message.c:2880
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
LONG WINAPI GetDialogBaseUnits(VOID)
Definition: dialog.c:2152
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:581
HWND WINAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Definition: dialog.c:2288
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
UINT yBaseUnit
Definition: dialog.c:56
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
LONG cx
Definition: windef.h:334
BOOL WINAPI IsWindowEnabled(_In_ HWND)
static BOOL DIALOG_CreateControls32(HWND hwnd, LPCSTR template, const DLG_TEMPLATE *dlgTemplate, HINSTANCE hInst, BOOL unicode)
Definition: dialog.c:287
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:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2944
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:2000
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)
#define WM_CANCELMODE
Definition: winuser.h:1617
GLenum GLsizei len
Definition: glext.h:6722
#define SetWindowLongPtrA
Definition: winuser.h:5320
UINT flags
Definition: dialog.c:58
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND hwndFocus
Definition: dialog.c:52
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:44
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
weight
Definition: sortkey.c:156
#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:3759
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:55
#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:54
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
_Out_opt_ int * cx
Definition: commctrl.h:581
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:309
static const WCHAR dc[]
#define LOGPIXELSY
Definition: wingdi.h:718
#define SetWindowLongPtrW
Definition: winuser.h:5321
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:335
#define WM_INITDIALOG
Definition: winuser.h:1721
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:403
#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 1535 of file dialog.c.

1537 {
1538  if (spec)
1539  {
1540  INT ret, len = MultiByteToWideChar( CP_ACP, 0, spec, -1, NULL, 0 );
1541  LPWSTR specW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
1542  if (specW == NULL)
1543  return FALSE;
1544  MultiByteToWideChar( CP_ACP, 0, spec, -1, specW, len );
1545  ret = DIALOG_DlgDirListW( hDlg, specW, idLBox, idStatic, attrib, combo );
1546  WideCharToMultiByte( CP_ACP, 0, specW, -1, spec, 0x7fffffff, NULL, NULL );
1547  HeapFree( GetProcessHeap(), 0, specW );
1548  return ret;
1549  }
1550  return DIALOG_DlgDirListW( hDlg, NULL, idLBox, idStatic, attrib, combo );
1551 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
int32_t INT
Definition: typedefs.h:57
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
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:1439
#define HeapFree(x, y, z)
Definition: compat.h:403

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 1439 of file dialog.c.

1441 {
1442  HWND hwnd;
1443  LPWSTR orig_spec = spec;
1444  WCHAR any[] = {'*','.','*',0};
1445  WCHAR star[] = {'*',0};
1446 
1447 #define SENDMSG(msg,wparam,lparam) \
1448  ((attrib & DDL_POSTMSGS) ? PostMessageW( hwnd, msg, wparam, lparam ) \
1449  : SendMessageW( hwnd, msg, wparam, lparam ))
1450 
1451  TRACE("%p %s %d %d %04x\n", hDlg, debugstr_w(spec), idLBox, idStatic, attrib );
1452 
1453  /* If the path exists and is a directory, chdir to it */
1454  if (!spec || !spec[0] || SetCurrentDirectoryW( spec )) spec = star;
1455  else
1456  {
1457  WCHAR *p, *p2;
1458 
1459  if (!strchrW(spec, '*') && !strchrW(spec, '?'))
1460  {
1462  return FALSE;
1463  }
1464  p = spec;
1465  if ((p2 = strchrW( p, ':' ))) p = p2 + 1;
1466  if ((p2 = strrchrW( p, '\\' ))) p = p2;
1467  if ((p2 = strrchrW( p, '/' ))) p = p2;
1468  if (p != spec)
1469  {
1470  WCHAR sep = *p;
1471  *p = 0;
1472  if (!SetCurrentDirectoryW( spec ))
1473  {
1474  *p = sep; /* Restore the original spec */
1475  return FALSE;
1476  }
1477  spec = p + 1;
1478  }
1479  }
1480 
1481  TRACE( "mask=%s\n", spec );
1482 
1483  if (idLBox && ((hwnd = GetDlgItem( hDlg, idLBox )) != 0))
1484  {
1485  if (attrib == DDL_DRIVES) attrib |= DDL_EXCLUSIVE;
1486 
1487  SENDMSG( combo ? CB_RESETCONTENT : LB_RESETCONTENT, 0, 0 );
1488  if (attrib & DDL_DIRECTORY)
1489  {
1490  if (!(attrib & DDL_EXCLUSIVE))
1491  {
1492  SENDMSG( combo ? CB_DIR : LB_DIR,
1493  attrib & ~(DDL_DIRECTORY | DDL_DRIVES),
1494  (LPARAM)spec );
1495  }
1496  SENDMSG( combo ? CB_DIR : LB_DIR,
1497  (attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
1498  (LPARAM)any );
1499  }
1500  else
1501  {
1502  SENDMSG( combo ? CB_DIR : LB_DIR, attrib, (LPARAM)spec );
1503  }
1504  }
1505 
1506  /* Convert path specification to uppercase */
1507  if (spec) CharUpperW(spec);
1508 
1509  if (idStatic && ((hwnd = GetDlgItem( hDlg, idStatic )) != 0))
1510  {
1511  WCHAR temp[MAX_PATH];
1512  GetCurrentDirectoryW( sizeof(temp)/sizeof(WCHAR), temp );
1513  CharLowerW( temp );
1514  /* Can't use PostMessage() here, because the string is on the stack */
1515  SetDlgItemTextW( hDlg, idStatic, temp );
1516  }
1517 
1518  if (orig_spec && (spec != orig_spec))
1519  {
1520  /* Update the original file spec */
1521  WCHAR *p = spec;
1522  while ((*orig_spec++ = *p++));
1523  }
1524 
1525  return TRUE;
1526 #undef SENDMSG
1527 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:2015
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:422
#define DDL_DIRECTORY
Definition: winuser.h:422
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
#define LB_RESETCONTENT
Definition: winuser.h:2037
#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:2832
#define CB_RESETCONTENT
Definition: winuser.h:1941
#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 SetLastError(x)
Definition: compat.h:418
#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:44
#define CB_DIR
Definition: winuser.h:1920
static calc_node_t temp
Definition: rpn_ieee.c:38
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2248
const char star
Definition: hash_test.cpp:23
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_NO_WILDCARD_CHARACTERS
Definition: winerror.h:898
#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 1558 of file dialog.c.

1560 {
1561  WCHAR *buffer, *ptr;
1562  INT item, size;
1563  BOOL ret;
1564  HWND listbox = GetDlgItem( hwnd, id );
1565 
1566  TRACE("%p %s %d\n", hwnd, unicode ? debugstr_w(str) : debugstr_a((LPSTR)str), id );
1567  if (!listbox) return FALSE;
1568 
1569  item = SendMessageW(listbox, combo ? CB_GETCURSEL : LB_GETCURSEL, 0, 0 );
1570  if (item == LB_ERR) return FALSE;
1571 
1572  size = SendMessageW(listbox, combo ? CB_GETLBTEXTLEN : LB_GETTEXTLEN, item, 0 );
1573  if (size == LB_ERR) return FALSE;
1574 
1575  if (!(buffer = HeapAlloc( GetProcessHeap(), 0, (size+2) * sizeof(WCHAR) ))) return FALSE;
1576 
1577  SendMessageW( listbox, combo ? CB_GETLBTEXT : LB_GETTEXT, item, (LPARAM)buffer );
1578 
1579  if ((ret = (buffer[0] == '['))) /* drive or directory */
1580  {
1581  if (buffer[1] == '-') /* drive */
1582  {
1583  buffer[3] = ':';
1584  buffer[4] = 0;
1585  ptr = buffer + 2;
1586  }
1587  else
1588  {
1589  buffer[strlenW(buffer)-1] = '\\';
1590  ptr = buffer + 1;
1591  }
1592  }
1593  else
1594  {
1595  /* Filenames without a dot extension must have one tacked at the end */
1596  if (strchrW(buffer, '.') == NULL)
1597  {
1598  buffer[strlenW(buffer)+1] = '\0';
1599  buffer[strlenW(buffer)] = '.';
1600  }
1601  ptr = buffer;
1602  }
1603 
1604  if (!unicode)
1605  {
1606  if (len > 0 && !WideCharToMultiByte( CP_ACP, 0, ptr, -1, (LPSTR)str, len, 0, 0 ))
1607  ((LPSTR)str)[len-1] = 0;
1608  }
1609  else lstrcpynW( str, ptr, len );
1610  HeapFree( GetProcessHeap(), 0, buffer );
1611  TRACE("Returning %d %s\n", ret, unicode ? debugstr_w(str) : debugstr_a((LPSTR)str) );
1612  return ret;
1613 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CB_GETLBTEXTLEN
Definition: winuser.h:1935
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:1934
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:57
#define CB_GETCURSEL
Definition: winuser.h:1925
#define lstrcpynW
Definition: compat.h:406
#define LB_ERR
Definition: winuser.h:2407
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:2032
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:404
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:2031
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:2021
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189
#define HeapFree(x, y, z)
Definition: compat.h:403

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

◆ DIALOG_DoDialogBox()

INT DIALOG_DoDialogBox ( HWND  hwnd,
HWND  owner 
)

Definition at line 504 of file dialog.c.

505 {
506  DIALOGINFO * dlgInfo;
507  MSG msg;
508  INT retval;
509  BOOL bFirstEmpty;
510  PWND pWnd;
511 
512  pWnd = ValidateHwnd(hwnd);
513  if (!pWnd) return -1;
514 
515  if (!(dlgInfo = GETDLGINFO(hwnd))) return -1;
516 
517  bFirstEmpty = TRUE;
518  if (!(dlgInfo->flags & DF_END)) /* was EndDialog called in WM_INITDIALOG ? */
519  {
520  for (;;)
521  {
522  if (!PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
523  {
524  if (bFirstEmpty)
525  {
526  /* ShowWindow the first time the queue goes empty */
528  bFirstEmpty = FALSE;
529  }
531  {
532  /* No message present -> send ENTERIDLE and wait */
534  }
535  GetMessageW( &msg, 0, 0, 0 );
536  }
537 
538  if (msg.message == WM_QUIT)
539  {
540  PostQuitMessage( msg.wParam );
541  if (!IsWindow( hwnd )) return 0;
542  break;
543  }
544 
545  /*
546  * If the user is pressing Ctrl+C, send a WM_COPY message.
547  * Guido Pola, CORE-4829, Is there another way to check if the Dialog is a MessageBox?
548  */
549  if (msg.message == WM_KEYDOWN &&
550  pWnd->state & WNDS_MSGBOX && // Yes!
552  {
553  if (msg.wParam == L'C' && GetKeyState(VK_CONTROL) < 0)
554  SendMessageW(hwnd, WM_COPY, 0, 0);
555  }
556 
557  if (!IsWindow( hwnd )) return 0;
558  if (!(dlgInfo->flags & DF_END) && !IsDialogMessageW( hwnd, &msg))
559  {
560  TranslateMessage( &msg );
561  DispatchMessageW( &msg );
562  }
563  if (!IsWindow( hwnd )) return 0;
564  if (dlgInfo->flags & DF_END) break;
565 
566  if (bFirstEmpty && msg.message == WM_TIMER)
567  {
569  bFirstEmpty = FALSE;
570  }
571  }
572  }
573  retval = dlgInfo->idResult;
574  DestroyWindow( hwnd );
575  return retval;
576 }
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:4804
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:57
#define GETDLGINFO(hwnd)
Definition: dialog.c:40
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define WM_COPY
Definition: winuser.h:1844
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
SHORT WINAPI GetKeyState(_In_ int)
#define WM_ENTERIDLE
Definition: winuser.h:1731
#define DS_NOIDLEMSG
Definition: winuser.h:377
INT idResult
Definition: dialog.c:57
#define WM_TIMER
Definition: winuser.h:1724
#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:58
#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:2178
BOOL WINAPI IsDialogMessageW(HWND hDlg, LPMSG lpMsg)
Definition: dialog.c:2547
#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 476 of file dialog.c.

477 {
478  while (GetWindowLongA(hwndDlg, GWL_STYLE) & DS_CONTROL)
479  {
480  PWND pWnd;
481  HWND hParent = GetParent(hwndDlg);
482  if (!hParent) break;
483 // ReactOS
484  if (!IsWindow(hParent)) break;
485 
486  pWnd = ValidateHwnd(hParent);
487  // FIXME: Use pWnd->fnid == FNID_DESKTOP
488  if (!pWnd || !TestWindowProcess(pWnd) || hParent == GetDesktopWindow()) break;
489 
490  if (!(pWnd->state & WNDS_DIALOGWINDOW))
491  {
492  break;
493  }
494 
495  hwndDlg = hParent;
496  }
497 
498  return hwndDlg;
499 }
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:656
#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 2467 of file dialog.c.

2468 {
2469  INT dlgcode_next = SendMessageW (hwndNext, WM_GETDLGCODE, 0, 0);
2470  /* INT dlgcode_dlg = SendMessageW (hwndDlg, WM_GETDLGCODE, 0, 0); */
2471  /* Windows does ask for this. I don't know why yet */
2472 
2474 
2475  /* If the button that is getting the focus WAS flagged as the default
2476  * pushbutton then ask the dialog what it thinks the default is and
2477  * set that in the default style.
2478  */
2479  if (dlgcode_next & DLGC_DEFPUSHBUTTON)
2480  {
2481  DWORD def_id = SendMessageW (hwndDlg, DM_GETDEFID, 0, 0);
2482  if (HIWORD(def_id) == DC_HASDEFID)
2483  {
2484  HWND hwndDef;
2485  def_id = LOWORD(def_id);
2486  hwndDef = GetDlgItem (hwndDlg, def_id);
2487  if (hwndDef)
2488  {
2489  INT dlgcode_def = SendMessageW (hwndDef, WM_GETDLGCODE, 0, 0);
2490  /* I know that if it is a button then it should already be a
2491  * UNDEFPUSHBUTTON, since we have just told the buttons to
2492  * change style. But maybe they ignored our request
2493  */
2494  if ((dlgcode_def & DLGC_BUTTON) &&
2495  (dlgcode_def & DLGC_UNDEFPUSHBUTTON))
2496  {
2498  }
2499  }
2500  }
2501  }
2502  else if ((dlgcode_next & DLGC_BUTTON) && (dlgcode_next & DLGC_UNDEFPUSHBUTTON))
2503  {
2505  /* I wonder why it doesn't send a DM_SETDEFID */
2506  }
2507 }
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
#define TRUE
Definition: types.h:120
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2591
#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:2451
int32_t INT
Definition: typedefs.h:57
#define DM_GETDEFID
Definition: winuser.h:2080
#define DC_HASDEFID
Definition: winuser.h:2584
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define BM_SETSTYLE
Definition: winuser.h:1906
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DLGC_BUTTON
Definition: winuser.h:2595
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189
#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 2451 of file dialog.c.

2453 {
2454  /* If a default pushbutton then no longer default */
2455  if (DLGC_DEFPUSHBUTTON & SendMessageW (hwndChild, WM_GETDLGCODE, 0, 0))
2456  SendMessageW (hwndChild, BM_SETSTYLE, BS_PUSHBUTTON, TRUE);
2457  return TRUE;
2458 }
#define TRUE
Definition: types.h:120
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2590
#define BM_SETSTYLE
Definition: winuser.h:1906
#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 133 of file dialog.c.

134 {
135  PWND pWindow;
136  DIALOGINFO* dlgInfo;
137 
138  pWindow = ValidateHwnd( hWnd );
139  if (!pWindow)
140  {
141  return NULL;
142  }
143 
145 
146  if (!dlgInfo && create)
147  {
148  if (pWindow && pWindow->cbwndExtra >= DLGWINDOWEXTRA)
149  {
150  if (!(dlgInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dlgInfo) )))
151  return NULL;
152 
153  dlgInfo->idResult = IDOK;
154  SETDLGINFO( hWnd, dlgInfo );
155  }
156  else
157  {
158  return NULL;
159  }
160  }
161 
162  if (dlgInfo)
163  {
164  if (!(pWindow->state & WNDS_DIALOGWINDOW))
165  {
166  NtUserxSetDialogPointer( hWnd, dlgInfo );
167  }
168  }
169  return dlgInfo;
170 }
#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:4804
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:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
INT idResult
Definition: dialog.c:57
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define DLGWINDOWEXTRA
Definition: winuser.h:2540
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 178 of file dialog.c.

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

Referenced by DIALOG_CreateControls32().

◆ DIALOG_GetNextTabItem()

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

Definition at line 1375 of file dialog.c.

1376 {
1377  LONG dsStyle;
1378  LONG exStyle;
1379  UINT wndSearch = fPrevious ? GW_HWNDPREV : GW_HWNDNEXT;
1380  HWND retWnd = 0;
1381  HWND hChildFirst = 0;
1382 
1383  if(!hwndCtrl)
1384  {
1385  hChildFirst = GetWindow(hwndDlg,GW_CHILD);
1386  if(fPrevious) hChildFirst = GetWindow(hChildFirst,GW_HWNDLAST);
1387  }
1388  else if (IsChild( hwndMain, hwndCtrl ))
1389  {
1390  hChildFirst = GetWindow(hwndCtrl,wndSearch);
1391  if(!hChildFirst)
1392  {
1393  if(GetParent(hwndCtrl) != hwndMain)
1394  /* i.e. if we are not at the top level of the recursion */
1395  hChildFirst = GetWindow(GetParent(hwndCtrl),wndSearch);
1396  else
1397  hChildFirst = GetWindow(hwndCtrl, fPrevious ? GW_HWNDLAST : GW_HWNDFIRST);
1398  }
1399  }
1400 
1401  while(hChildFirst)
1402  {
1403  dsStyle = GetWindowLongPtrA(hChildFirst,GWL_STYLE);
1404  exStyle = GetWindowLongPtrA(hChildFirst,GWL_EXSTYLE);
1405  if( (exStyle & WS_EX_CONTROLPARENT) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
1406  {
1407  HWND retWnd;
1408  retWnd = DIALOG_GetNextTabItem(hwndMain,hChildFirst,NULL,fPrevious );
1409  if (retWnd) return (retWnd);
1410  }
1411  else if( (dsStyle & WS_TABSTOP) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
1412  {
1413  return (hChildFirst);
1414  }
1415  hChildFirst = GetWindow(hChildFirst,wndSearch);
1416  }
1417  if(hwndCtrl)
1418  {
1419  HWND hParent = GetParent(hwndCtrl);
1420  while(hParent)
1421  {
1422  if(hParent == hwndMain) break;
1423  retWnd = DIALOG_GetNextTabItem(hwndMain,GetParent(hParent),hParent,fPrevious );
1424  if(retWnd) break;
1426  }
1427  if(!retWnd)
1428  retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,NULL,fPrevious );
1429  }
1430  return retWnd ? retWnd : hwndCtrl;
1431 }
#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:4803
#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:1375
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 2517 of file dialog.c.

2518 {
2519  int i;
2520  HWND *list = WIN_ListChildren( hwndDlg );
2521  HWND ret = 0;
2522 
2523  if (!list) return 0;
2524 
2525  for (i = 0; list[i]; i++)
2526  {
2527  if (GetWindowLongPtrW( list[i], GWLP_ID ) == id)
2528  {
2529  ret = list[i];
2530  break;
2531  }
2532 
2533  /* Recurse into every child */
2534  if ((ret = DIALOG_IdToHwnd( list[i], id ))) break;
2535  }
2536 
2537  HeapFree( GetProcessHeap(), 0, list );
2538  return ret;
2539 }
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:2517
#define GetProcessHeap()
Definition: compat.h:404
int ret
Definition: _list.h:228
HWND * WIN_ListChildren(HWND hWndparent)
Definition: mdi.c:140
#define HeapFree(x, y, z)
Definition: compat.h:403
#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 394 of file dialog.c.

395 {
396  HWND hwndControl = hwnd;
397  HWND hwndNext;
398  INT dlgCode;
399  WCHAR buffer[128];
400 
401  do
402  {
403  DWORD style = GetWindowLongPtrW( hwndControl, GWL_STYLE );
404  if ((style & (WS_VISIBLE | WS_DISABLED)) == WS_VISIBLE)
405  {
406  dlgCode = SendMessageW( hwndControl, WM_GETDLGCODE, 0, 0 );
407  if ( (dlgCode & (DLGC_BUTTON | DLGC_STATIC)) &&
408  GetWindowTextW( hwndControl, buffer, sizeof(buffer)/sizeof(WCHAR) ))
409  {
410  /* find the accelerator key */
411  LPWSTR p = buffer - 2;
412 
413  do
414  {
415  p = strchrW( p + 2, '&' );
416  }
417  while (p != NULL && p[1] == '&');
418 
419  /* and check if it's the one we're looking for */
420  if (p != NULL && toupperW( p[1] ) == toupperW( wParam ) )
421  {
422  if ((dlgCode & DLGC_STATIC) || (style & 0x0f) == BS_GROUPBOX )
423  {
424  /* set focus to the control */
425  SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndControl, 1);
426  /* and bump it on to next */
427  SendMessageW( hwndDlg, WM_NEXTDLGCTL, 0, 0);
428  }
429  else if (dlgCode & DLGC_BUTTON)
430  {
431  /* send BM_CLICK message to the control */
432  SendMessageW( hwndControl, BM_CLICK, 0, 0 );
433  }
434  return TRUE;
435  }
436  }
437  hwndNext = GetWindow( hwndControl, GW_CHILD );
438  }
439  else hwndNext = 0;
440 
441  if (!hwndNext) hwndNext = GetWindow( hwndControl, GW_HWNDNEXT );
442 
443  while (!hwndNext && hwndControl)
444  {
445  hwndControl = GetParent( hwndControl );
446  if (hwndControl == hwndDlg)
447  {
448  if(hwnd==hwndDlg) /* prevent endless loop */
449  {
450  hwndNext=hwnd;
451  break;
452  }
453  hwndNext = GetWindow( hwndDlg, GW_CHILD );
454  }
455  else
456  hwndNext = GetWindow( hwndControl, GW_HWNDNEXT );
457  }
458  hwndControl = hwndNext;
459  }
460  while (hwndControl && (hwndControl != hwnd));
461 
462  return FALSE;
463 }
#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:4804
int32_t INT
Definition: typedefs.h:57
#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:1899
__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:44
HWND WINAPI GetParent(_In_ HWND)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define DLGC_BUTTON
Definition: winuser.h:2595
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:2594

Referenced by IsDialogMessageW().

◆ DIALOG_ParseTemplate32()

static LPCSTR DIALOG_ParseTemplate32 ( LPCSTR  template,
DLG_TEMPLATE result 
)
static

Definition at line 584 of file dialog.c.

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

1875 {
1876  return DialogBoxIndirectParamAorW( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, DLG_ISANSI);
1877 }
#define DLG_ISANSI
Definition: dialog.c:45
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:1845

◆ DialogBoxIndirectParamAorW()

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

Definition at line 1845 of file dialog.c.

1852 {
1853 /* FIXME:
1854  * This function might be obsolete since I don't think it is exported by NT
1855  * Also wine has one more parameter identifying weather it should call
1856  * the function with unicode or not
1857  */
1858  HWND hWnd = DIALOG_CreateIndirect( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, Flags == DLG_ISANSI ? FALSE : TRUE, &hWndParent );
1859  if (hWnd) return DIALOG_DoDialogBox( hWnd, hWndParent );
1860  return -1;
1861 }
#define TRUE
Definition: types.h:120
INT DIALOG_DoDialogBox(HWND hwnd, HWND owner)
Definition: dialog.c:504
#define DLG_ISANSI
Definition: dialog.c:45
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:774

Referenced by DialogBoxIndirectParamA(), and DialogBoxIndirectParamW().

◆ DialogBoxIndirectParamW()

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

Definition at line 1885 of file dialog.c.

1891 {
1892  return DialogBoxIndirectParamAorW( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, 0);
1893 }
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:1845

◆ DialogBoxParamA()

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

Definition at line 1901 of file dialog.c.

1907 {
1908  HWND hwnd;
1909  HRSRC hrsrc;
1912  if (!(hrsrc = FindResourceA( hInstance, lpTemplateName, (LPCSTR)RT_DIALOG )) ||
1913  !(ptr = LoadResource(hInstance, hrsrc)))
1914  {
1916  return -1;
1917  }
1918  if (hWndParent != NULL && !IsWindow(hWndParent))
1919  {
1921  return 0;
1922  }
1923  hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, FALSE, &hWndParent );
1924  if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent);
1925  return -1;
1926 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
INT DIALOG_DoDialogBox(HWND hwnd, HWND owner)
Definition: dialog.c:504
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:418
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:44
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:774

Referenced by test_DialogBoxParam(), test_DisabledDialogTest(), and test_GetDlgItem().

◆ DialogBoxParamW()

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

Definition at line 1934 of file dialog.c.

1940 {
1941  HWND hwnd;
1942  HRSRC hrsrc;
1945  if (!(hrsrc = FindResourceW( hInstance, lpTemplateName, (LPCWSTR)RT_DIALOG )) ||
1946  !(ptr = LoadResource(hInstance, hrsrc)))
1947  {
1949  return -1;
1950  }
1951  if (hWndParent != NULL && !IsWindow(hWndParent))
1952  {
1954  return 0;
1955  }
1956  hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, TRUE, &hWndParent );
1957  if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent);
1958  return -1;
1959 }
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:504
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:418
static HWND hwnd[MAXHWNDS]
Definition: dialog.c:44
static HWND DIALOG_CreateIndirect(HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, BOOL unicode, HWND *modal_owner)
Definition: dialog.c:774

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 1967 of file dialog.c.

1973 {
1974  return DIALOG_DlgDirListA( hDlg, lpPathSpec, nIDListBox, nIDStaticPath, uFileType, FALSE );
1975 }
static INT DIALOG_DlgDirListA(HWND hDlg, LPSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1535

◆ DlgDirListComboBoxA()

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

Definition at line 1983 of file dialog.c.

1989 {
1990  return DIALOG_DlgDirListA( hDlg, lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype, TRUE );
1991 }
#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:1535

◆ DlgDirListComboBoxW()

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

Definition at line 1999 of file dialog.c.

2005 {
2006  return DIALOG_DlgDirListW( hDlg, lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype, TRUE );
2007 }
#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:1439

◆ DlgDirListW()

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

Definition at line 2015 of file dialog.c.

2021 {
2022  return DIALOG_DlgDirListW( hDlg, lpPathSpec, nIDListBox, nIDStaticPath, uFileType, FALSE );
2023 }
static INT DIALOG_DlgDirListW(HWND hDlg, LPWSTR spec, INT idLBox, INT idStatic, UINT attrib, BOOL combo)
Definition: dialog.c:1439

◆ DlgDirSelectComboBoxExA()

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

Definition at line 2031 of file dialog.c.

2036 {
2037  return DIALOG_DlgDirSelect( hDlg, (LPWSTR)lpString, nCount, nIDComboBox, FALSE, TRUE );
2038 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1558
#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 2046 of file dialog.c.

2051 {
2052  return DIALOG_DlgDirSelect( hDlg, (LPWSTR)lpString, nCount, nIDComboBox, TRUE, TRUE );
2053 }
static BOOL DIALOG_DlgDirSelect(HWND hwnd, LPWSTR str, INT len, INT id, BOOL unicode, BOOL combo)
Definition: dialog.c:1558
#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 2061 of file dialog.c.

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

◆ DlgDirSelectExW()

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

Definition at line 2076 of file dialog.c.

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

◆ EndDialog()

BOOL WINAPI EndDialog ( HWND  hwnd,
INT_PTR  retval 
)

Definition at line 2091 of file dialog.c.

2094 {
2095  DIALOGINFO * dlgInfo;
2096  HWND owner;
2097  BOOL wasActive;
2098 
2099  TRACE("%p %ld\n", hwnd, retval );
2100 
2101  if (!(dlgInfo = GETDLGINFO(hwnd)))
2102  {
2103  ERR("got invalid window handle (%p); buggy app !?\n", hwnd);
2104  return FALSE;
2105  }
2106  wasActive = (hwnd == GetActiveWindow());
2107  dlgInfo->idResult = retval;
2108  dlgInfo->flags |= DF_END;
2109 
2111  {
2113  }
2114  else
2115  owner = GetWindow( hwnd, GW_OWNER );
2116 
2117  if (owner)
2118  EnableWindow( owner, TRUE );
2119 
2120  /* Windows sets the focus to the dialog itself in EndDialog */
2121 
2122  if (wasActive && IsChild(hwnd, GetFocus()))
2123  SetFocus( hwnd );
2124 
2125  /* Don't have to send a ShowWindow(SW_HIDE), just do
2126  SetWindowPos with SWP_HIDEWINDOW as done in Windows */
2127 
2128  SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE
2130 
2131  if (wasActive && owner)
2132  {
2133  /* If this dialog was given an owner then set the focus to that owner. */
2135  }
2136  else if (hwnd == GetActiveWindow()) // Check it again!
2137  {
2139  }
2140 
2141  /* unblock dialog loop */
2142  PostMessageA(hwnd, WM_NULL, 0, 0);
2143  return TRUE;
2144 }
#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:2763
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:57
#define SWP_NOACTIVATE
Definition: winuser.h:1227
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
UINT flags
Definition: dialog.c:58
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:110
#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:1909
#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(), getdlgitem_test_dialog_proc(), 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 2152 of file dialog.c.

2153 {
2154  static DWORD units;
2155 
2156  if (!units)
2157  {
2158  HDC hdc;
2159  SIZE size;
2160 
2161  if ((hdc = GetDC(0)))
2162  {
2163  size.cx = GdiGetCharDimensions( hdc, NULL, &size.cy );
2164  if (size.cx) units = MAKELONG( size.cx, size.cy );
2165  ReleaseDC( 0, hdc );
2166  }
2167  }
2168  return units;
2169 }
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(), test_dpi_mapping(), and test_menu_ownerdraw().

◆ GetDlgCtrlID()

int WINAPI GetDlgCtrlID ( HWND  hwndCtl)

Definition at line 2177 of file dialog.c.

2179 {
2180  return GetWindowLongPtrW( hwndCtl, GWLP_ID );
2181 }
#define GetWindowLongPtrW
Definition: winuser.h:4804
#define GWLP_ID
Definition: winuser.h:854

Referenced by DEFDLG_Proc(), and IsDialogMessageW().

◆ GetDlgItem()

HWND WINAPI GetDlgItem ( HWND  hDlg,
int  nIDDlgItem 
)

Definition at line 2189 of file dialog.c.

2192 {
2193  int i;
2194  HWND *list;
2195  HWND ret = 0;
2196 
2197  if (!hDlg) return 0;
2198 
2199  list = WIN_ListChildren(hDlg);
2200  if (!list) return 0;
2201 
2202  for (i = 0; list[i]; i++) if (GetWindowLongPtrW(list[i], GWLP_ID) == nIDDlgItem) break;
2203  ret = list[i];
2204  HeapFree(GetProcessHeap(), 0, list);
2205 // if (!ret) SetLastError(ERROR_CONTROL_ID_NOT_FOUND);
2206  return ret;
2207 }
_In_ int nIDDlgItem
Definition: winuser.h:4594
#define GetWindowLongPtrW
Definition: winuser.h:4804
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:404
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:403
#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(), focusChildDlgWinProc(), focusDlgWinProc(), getdlgitem_test_dialog_proc(), 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 2215 of file dialog.c.

2220 {
2221  char str[30];
2222  char * endptr;
2223  LONG_PTR result = 0;
2224 
2225  if (lpTranslated) *lpTranslated = FALSE;
2226  if (!SendDlgItemMessageA(hDlg, nIDDlgItem, WM_GETTEXT, sizeof(str), (LPARAM)str))
2227  return 0;
2228  if (bSigned)
2229  {
2230  result = strtol( str, &endptr, 10 );
2231  if (!endptr || (endptr == str)) /* Conversion was unsuccessful */
2232  return 0;
2233  if (((result == LONG_MIN) || (result == LONG_MAX)))
2234  return 0;
2235  }
2236  else
2237  {
2238  result = strtoul( str, &endptr, 10 );
2239  if (!endptr || (endptr == str)) /* Conversion was unsuccessful */
2240  return 0;
2241  if (result == ULONG_MAX) return 0;
2242  }
2243  if (lpTranslated) *lpTranslated = TRUE;
2244  return (UINT)result;
2245 }
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:4594
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:2756
__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 2253 of file dialog.c.

2258 {
2259  HWND hWnd = GetDlgItem(hDlg, nIDDlgItem);
2260  if ( hWnd ) return GetWindowTextA(hWnd, lpString, nMaxCount);
2261  if ( nMaxCount ) lpString[0] = '\0';
2262  return 0;
2263 }
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
HWND hWnd
Definition: settings.c:17
_In_ int nIDDlgItem
Definition: winuser.h:4594
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189
_In_ int nMaxCount
Definition: winuser.h:4852

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

◆ GetDlgItemTextW()

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

Definition at line 2271 of file dialog.c.

2276 {
2277  HWND hWnd = GetDlgItem(hDlg, nIDDlgItem);
2278  if ( hWnd ) return GetWindowTextW(hWnd, lpString, nMaxCount);
2279  if ( nMaxCount ) lpString[0] = '\0';
2280  return 0;
2281 }
HWND hWnd
Definition: settings.c:17
_In_ int nIDDlgItem
Definition: winuser.h:4594
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2189
_In_ int nMaxCount
Definition: winuser.h:4852

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(), DNSSuffixPropDlgProc(), 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(), IsValidDomainName(), 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 2288 of file dialog.c.

2292 {
2293  HWND hwnd, hwndNext, retvalue, hwndLastGroup = 0;
2294  BOOL fLooped=FALSE;
2295  BOOL fSkipping=FALSE;
2296 
2297  if (hDlg == hCtl) hCtl = NULL;
2298  if (!hCtl && bPrevious) return 0;
2299 
2300  /* if the hwndCtrl is the child of the control in the hwndDlg,
2301  * then the hwndDlg has to be the parent of the hwndCtrl */
2302 
2303  if (hCtl)
2304  {
2305  if (!IsChild (hDlg, hCtl)) return 0;
2306  /* Make sure hwndCtrl is a top-level child */
2307 
2308  }
2309  else
2310  {
2311  /* No ctrl specified -> start from the beginning */
2312  if (!(hCtl = GetWindow( hDlg, GW_CHILD ))) return 0;
2313  /* MSDN is wrong. fPrevious does not result in the last child */
2314 
2315  /* No ctrl specified -> start from the beginning */
2316  if (!(hCtl = GetWindow( hDlg, GW_CHILD ))) return 0;
2317 
2318  /* MSDN is wrong. fPrevious does not result in the last child */
2319 
2320  /* Maybe that first one is valid. If so then we don't want to skip it*/
2322  {
2323  return hCtl;
2324  }
2325 
2326  }
2327 
2328  /* Always go forward around the group and list of controls; for the
2329  * previous control keep track; for the next break when you find one
2330  */
2331  retvalue = hCtl;
2332  hwnd = hCtl;
2333  while (1)
2334  {
2335  hwndNext = GetWindow (hwnd, GW_HWNDNEXT);
2336  while (!hwndNext)
2337  {
2338  /* Climb out until there is a next sibling of the ancestor or we
2339  * reach the top (in which case we loop back to the start)
2340  */
2341  if (hDlg == GetParent (hwnd))
2342  {
2343  /* Wrap around to the beginning of the list, within the same
2344  * group. (Once only)
2345  */
2346  if (fLooped) goto end;
2347  fLooped = TRUE;
2348  hwndNext = GetWindow (hDlg, GW_CHILD);
2349  }
2350  else
2351  {
2352  hwnd = GetParent (hwnd);
2353  hwndNext = GetWindow (hwnd, GW_HWNDNEXT);
2354  }
2355  }
2356  hwnd = hwndNext;
2357 
2358  /* Wander down the leading edge of controlparents */
2361  (hwndNext = GetWindow (hwnd, GW_CHILD)))
2362  hwnd = hwndNext;
2363  /* Question. If the control is a control parent but either has no
2364  * children or is not visible/enabled then if it has a WS_GROUP does
2365  * it count? For that matter does it count anyway?
2366  * I believe it doesn't count.
2367  */
2368 
2370  {
2371  hwndLastGroup = hwnd;
2372  if (!fSkipping)
2373  {
2374  /* Look for the beginning of the group */
2375  fSkipping = TRUE;
2376  }
2377  }
2378 
2379  if (hwnd == hCtl)
2380  {
2381  if (!fSkipping) break;
2382  if (hwndLastGroup == hwnd) break;
2383  hwnd = hwndLastGroup;
2384  fSkipping = FALSE;
2385  fLooped = FALSE;
2386  }
2387 
2388  if (!fSkipping &&
2390  WS_VISIBLE)
2391  {
2392  retvalue = hwnd;
2393  if (!bPrevious) break;
2394  }
2395  }
2396 end:
2397  return retvalue;
2398 }
#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:4804
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
unsigned int BOOL
Definition: ntddk_ex.h:94