ReactOS  0.4.15-dev-2776-g4130f0b
dialogs.cpp File Reference
#include "precomp.h"
Include dependency graph for dialogs.cpp:

Go to the source code of this file.

Classes

struct  RUNFILEDLGPARAMS
 
struct  LOGOFF_DLG_CONTEXT
 
struct  PICK_ICON_CONTEXT
 

Macros

#define CX_ICON   GetSystemMetrics(SM_CXICON)
 
#define CY_ICON   GetSystemMetrics(SM_CYICON)
 
#define CX_ITEM   (CX_ICON + 4)
 
#define CY_ITEM   (CY_ICON + 12)
 
#define IS_PRODUCT_VERSION_WORKSTATION   0x300
 
#define FRIENDLY_LOGOFF_IS_NOT_ENFORCED   0x0
 
#define FONT_POINT_SIZE   13
 
#define DARK_GREY_COLOR   RGB(244, 244, 244)
 
#define LIGHT_GREY_COLOR   RGB(38, 38, 38)
 
#define CX_BITMAP   33
 
#define CY_BITMAP   33
 
#define NUMBER_OF_BUTTONS   2
 
#define BUTTON_SWITCH_USER   0
 
#define BUTTON_SWITCH_USER_PRESSED   (CY_BITMAP + BUTTON_SWITCH_USER)
 
#define BUTTON_SWITCH_USER_FOCUSED   (CY_BITMAP + BUTTON_SWITCH_USER_PRESSED)
 
#define BUTTON_LOG_OFF   (CY_BITMAP + BUTTON_SWITCH_USER_FOCUSED)
 
#define BUTTON_LOG_OFF_PRESSED   (CY_BITMAP + BUTTON_LOG_OFF)
 
#define BUTTON_LOG_OFF_FOCUSED   (CY_BITMAP + BUTTON_LOG_OFF_PRESSED)
 
#define BUTTON_SWITCH_USER_DISABLED   (CY_BITMAP + BUTTON_LOG_OFF_FOCUSED)
 

Typedefs

typedef struct LOGOFF_DLG_CONTEXTPLOGOFF_DLG_CONTEXT
 
typedef BOOL(WINAPILPFNOFN) (OPENFILENAMEW *)
 
typedef struct PICK_ICON_CONTEXTPPICK_ICON_CONTEXT
 
typedef HRESULT(WINAPItShellDimScreen) (IUnknown **Unknown, HWND *hWindow)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static INT_PTR CALLBACK RunDlgProc (HWND, UINT, WPARAM, LPARAM)
 
static void FillList (HWND, LPWSTR, UINT, BOOL)
 
BOOL CALLBACK EnumPickIconResourceProc (HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
 
static void DestroyIconList (HWND hDlgCtrl, PPICK_ICON_CONTEXT pIconContext)
 
static BOOL DoLoadIcons (HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile)
 
static void NoIconsInFile (HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext)
 
INT_PTR CALLBACK PickIconProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI PickIconDlg (HWND hWndOwner, LPWSTR lpstrFile, UINT nMaxFile, INT *lpdwIconIndex)
 
void WINAPI RunFileDlg (HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
 
static LPWSTR RunDlg_GetParentDir (LPCWSTR cmdline)
 
static void EnableOkButtonFromEditContents (HWND hwnd)
 
static BOOL ConfirmDialog (HWND hWndOwner, UINT PromptId, UINT TitleId)
 
BOOL CallShellDimScreen (IUnknown **pUnknown, HWND *hWindow)
 
static BOOL EnablePrivilege (LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
 
int WINAPI RestartDialogEx (HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
 
BOOL DrawIconOnOwnerDrawnButtons (DRAWITEMSTRUCT *pdis, PLOGOFF_DLG_CONTEXT pContext)
 
INT_PTR CALLBACK OwnerDrawButtonSubclass (HWND hButton, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID CreateToolTipForButtons (int controlID, int detailID, HWND hDlg, int titleID)
 
static BOOL IsFriendlyUIActive (VOID)
 
static VOID FancyLogoffOnInit (HWND hwnd, PLOGOFF_DLG_CONTEXT pContext)
 
INT_PTR CALLBACK LogOffDialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
EXTERN_C int WINAPI LogoffWindowsDialog (HWND hWndOwner)
 
int WINAPI RestartDialog (HWND hWndOwner, LPCWSTR lpstrReason, DWORD uFlags)
 
VOID ExitWindowsDialog_backup (HWND hWndOwner)
 
void WINAPI ExitWindowsDialog (HWND hWndOwner)
 

Variables

static const LPCWSTR s_pszDefaultPath = L"%SystemRoot%\\system32\\shell32.dll"
 

Macro Definition Documentation

◆ BUTTON_LOG_OFF

#define BUTTON_LOG_OFF   (CY_BITMAP + BUTTON_SWITCH_USER_FOCUSED)

Definition at line 1098 of file dialogs.cpp.

◆ BUTTON_LOG_OFF_FOCUSED

#define BUTTON_LOG_OFF_FOCUSED   (CY_BITMAP + BUTTON_LOG_OFF_PRESSED)

Definition at line 1100 of file dialogs.cpp.

◆ BUTTON_LOG_OFF_PRESSED

#define BUTTON_LOG_OFF_PRESSED   (CY_BITMAP + BUTTON_LOG_OFF)

Definition at line 1099 of file dialogs.cpp.

◆ BUTTON_SWITCH_USER

#define BUTTON_SWITCH_USER   0

Definition at line 1095 of file dialogs.cpp.

◆ BUTTON_SWITCH_USER_DISABLED

#define BUTTON_SWITCH_USER_DISABLED   (CY_BITMAP + BUTTON_LOG_OFF_FOCUSED)

Definition at line 1101 of file dialogs.cpp.

◆ BUTTON_SWITCH_USER_FOCUSED

#define BUTTON_SWITCH_USER_FOCUSED   (CY_BITMAP + BUTTON_SWITCH_USER_PRESSED)

Definition at line 1097 of file dialogs.cpp.

◆ BUTTON_SWITCH_USER_PRESSED

#define BUTTON_SWITCH_USER_PRESSED   (CY_BITMAP + BUTTON_SWITCH_USER)

Definition at line 1096 of file dialogs.cpp.

◆ CX_BITMAP

#define CX_BITMAP   33

Definition at line 1089 of file dialogs.cpp.

◆ CX_ICON

Definition at line 181 of file dialogs.cpp.

◆ CX_ITEM

#define CX_ITEM   (CX_ICON + 4)

Definition at line 185 of file dialogs.cpp.

◆ CY_BITMAP

#define CY_BITMAP   33

Definition at line 1090 of file dialogs.cpp.

◆ CY_ICON

Definition at line 182 of file dialogs.cpp.

◆ CY_ITEM

#define CY_ITEM   (CY_ICON + 12)

Definition at line 186 of file dialogs.cpp.

◆ DARK_GREY_COLOR

#define DARK_GREY_COLOR   RGB(244, 244, 244)

Definition at line 1085 of file dialogs.cpp.

◆ FONT_POINT_SIZE

#define FONT_POINT_SIZE   13

Definition at line 1083 of file dialogs.cpp.

◆ FRIENDLY_LOGOFF_IS_NOT_ENFORCED

#define FRIENDLY_LOGOFF_IS_NOT_ENFORCED   0x0

Definition at line 1081 of file dialogs.cpp.

◆ IS_PRODUCT_VERSION_WORKSTATION

#define IS_PRODUCT_VERSION_WORKSTATION   0x300

Definition at line 1080 of file dialogs.cpp.

◆ LIGHT_GREY_COLOR

#define LIGHT_GREY_COLOR   RGB(38, 38, 38)

Definition at line 1086 of file dialogs.cpp.

◆ NUMBER_OF_BUTTONS

#define NUMBER_OF_BUTTONS   2

Definition at line 1092 of file dialogs.cpp.

Typedef Documentation

◆ LPFNOFN

typedef BOOL(WINAPI * LPFNOFN) (OPENFILENAMEW *)

Definition at line 46 of file dialogs.cpp.

◆ PLOGOFF_DLG_CONTEXT

◆ PPICK_ICON_CONTEXT

◆ tShellDimScreen

typedef HRESULT(WINAPI * tShellDimScreen) (IUnknown **Unknown, HWND *hWindow)

Definition at line 1005 of file dialogs.cpp.

Function Documentation

◆ CallShellDimScreen()

BOOL CallShellDimScreen ( IUnknown **  pUnknown,
HWND hWindow 
)

Definition at line 1008 of file dialogs.cpp.

1009 {
1011  static BOOL Initialized = FALSE;
1012  if (!Initialized)
1013  {
1014  HMODULE mod = LoadLibraryW(L"msgina.dll");
1016  Initialized = TRUE;
1017  }
1018 
1019  HRESULT hr = E_FAIL;
1020  if (ShellDimScreen)
1021  hr = ShellDimScreen(pUnknown, hWindow);
1022  return SUCCEEDED(hr);
1023 }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
tShellDimScreen ShellDimScreen
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define LoadLibraryW(x)
Definition: compat.h:606
const char * LPCSTR
Definition: xmlstorage.h:183
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
LONG HRESULT
Definition: typedefs.h:79
static const WCHAR L[]
Definition: oid.c:1250
HRESULT(WINAPI * tShellDimScreen)(IUnknown **Unknown, HWND *hWindow)
Definition: dialogs.cpp:1005
#define GetProcAddress(x, y)
Definition: compat.h:612
static int mod
Definition: i386-dis.c:1281

Referenced by ExitWindowsDialog(), LogoffWindowsDialog(), and RestartDialogEx().

◆ ConfirmDialog()

static BOOL ConfirmDialog ( HWND  hWndOwner,
UINT  PromptId,
UINT  TitleId 
)
static

Definition at line 995 of file dialogs.cpp.

996 {
997  WCHAR Prompt[256];
998  WCHAR Title[256];
999 
1000  LoadStringW(shell32_hInstance, PromptId, Prompt, _countof(Prompt));
1002  return MessageBoxW(hWndOwner, Prompt, Title, MB_YESNO | MB_ICONQUESTION) == IDYES;
1003 }
#define IDYES
Definition: winuser.h:829
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MB_YESNO
Definition: winuser.h:811
#define MB_ICONQUESTION
Definition: winuser.h:783
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define shell32_hInstance

Referenced by ExitWindowsDialog_backup(), and RestartDialogEx().

◆ CreateToolTipForButtons()

VOID CreateToolTipForButtons ( int  controlID,
int  detailID,
HWND  hDlg,
int  titleID 
)

Definition at line 1250 of file dialogs.cpp.

1251 {
1252  HWND hwndTool = NULL, hwndTip = NULL;
1253  WCHAR szBuffer[256];
1254  TTTOOLINFOW tool;
1255 
1256  hwndTool = GetDlgItem(hDlg, controlID);
1257 
1258  tool.cbSize = sizeof(tool);
1259  tool.hwnd = hDlg;
1260  tool.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
1261  tool.uId = (UINT_PTR)hwndTool;
1262 
1263  /* Create the tooltip */
1264  hwndTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL,
1268  hDlg, NULL, shell32_hInstance, NULL);
1269 
1270  /* Associate the tooltip with the tool. */
1271  LoadStringW(shell32_hInstance, detailID, szBuffer, _countof(szBuffer));
1272  tool.lpszText = szBuffer;
1273  SendMessageW(hwndTip, TTM_ADDTOOLW, 0, (LPARAM)&tool);
1274  LoadStringW(shell32_hInstance, titleID, szBuffer, _countof(szBuffer));
1275  SendMessageW(hwndTip, TTM_SETTITLEW, TTI_NONE, (LPARAM)szBuffer);
1276  SendMessageW(hwndTip, TTM_SETMAXTIPWIDTH, 0, 250);
1277 }
unsigned __int3264 UINT_PTR
Definition: activex.cpp:275
#define TTS_BALLOON
Definition: commctrl.h:1761
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LPWSTR lpszText
Definition: commctrl.h:1746
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define CW_USEDEFAULT
Definition: winuser.h:225
LONG_PTR LPARAM
Definition: windef.h:208
#define TTM_SETTITLEW
Definition: commctrl.h:1828
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define TTI_NONE
Definition: commctrl.h:1779
UINT_PTR uId
Definition: commctrl.h:1743
#define TTM_SETMAXTIPWIDTH
Definition: commctrl.h:1819
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
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 shell32_hInstance
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
#define TTF_SUBCLASS
Definition: commctrl.h:1767

Referenced by FancyLogoffOnInit().

◆ DestroyIconList()

static void DestroyIconList ( HWND  hDlgCtrl,
PPICK_ICON_CONTEXT  pIconContext 
)
static

Definition at line 87 of file dialogs.cpp.

88 {
89  int count;
90  int index;
91 
92  count = SendMessageW(hDlgCtrl, LB_GETCOUNT, 0, 0);
93  if (count == LB_ERR)
94  return;
95 
96  for(index = 0; index < count; index++)
97  {
98  DestroyIcon(pIconContext->phIcons[index]);
99  pIconContext->phIcons[index] = NULL;
100  }
101 }
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define LB_ERR
Definition: winuser.h:2407
GLuint index
Definition: glext.h:6031
#define LB_GETCOUNT
Definition: winuser.h:2020
#define index(s, c)
Definition: various.h:29
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112

Referenced by DoLoadIcons(), and PickIconProc().

◆ DoLoadIcons()

static BOOL DoLoadIcons ( HWND  hwndDlg,
PPICK_ICON_CONTEXT  pIconContext,
LPCWSTR  pszFile 
)
static

Definition at line 104 of file dialogs.cpp.

105 {
106  WCHAR szExpandedPath[MAX_PATH];
107 
108  // Destroy previous icons
109  DestroyIconList(pIconContext->hDlgCtrl, pIconContext);
110  SendMessageW(pIconContext->hDlgCtrl, LB_RESETCONTENT, 0, 0);
111  delete[] pIconContext->phIcons;
112 
113  // Store the path
114  StringCchCopyW(pIconContext->szPath, _countof(pIconContext->szPath), pszFile);
115  ExpandEnvironmentStringsW(pszFile, szExpandedPath, _countof(szExpandedPath));
116 
117  // Load the module if possible
119  if (pIconContext->hLibrary)
120  FreeLibrary(pIconContext->hLibrary);
121  pIconContext->hLibrary = hLibrary;
122 
123  if (pIconContext->hLibrary)
124  {
125  // Load the icons from the module
126  pIconContext->nIcons = ExtractIconExW(szExpandedPath, -1, NULL, NULL, 0);
127  pIconContext->phIcons = new HICON[pIconContext->nIcons];
128 
129  if (ExtractIconExW(szExpandedPath, 0, pIconContext->phIcons, NULL, pIconContext->nIcons))
130  {
132  }
133  else
134  {
135  pIconContext->nIcons = 0;
136  }
137  }
138  else
139  {
140  // .ico file
141  pIconContext->nIcons = 1;
142  pIconContext->phIcons = new HICON[1];
143 
144  if (ExtractIconExW(szExpandedPath, 0, pIconContext->phIcons, NULL, pIconContext->nIcons))
145  {
146  SendMessageW(pIconContext->hDlgCtrl, LB_ADDSTRING, 0, 0);
147  }
148  else
149  {
150  pIconContext->nIcons = 0;
151  }
152  }
153 
154  // Set the text and reset the edit control's modification flag
155  SetDlgItemTextW(hwndDlg, IDC_EDIT_PATH, pIconContext->szPath);
157 
158  if (pIconContext->nIcons == 0)
159  {
160  delete[] pIconContext->phIcons;
161  pIconContext->phIcons = NULL;
162  }
163 
164  return (pIconContext->nIcons > 0);
165 }
#define RT_GROUP_ICON
Definition: pedump.c:375
static HICON
Definition: imagelist.c:84
#define LB_ADDSTRING
Definition: winuser.h:2013
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define SendDlgItemMessage
Definition: winuser.h:5817
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define LB_RESETCONTENT
Definition: winuser.h:2037
#define FALSE
Definition: types.h:117
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:872
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
BOOL CALLBACK EnumPickIconResourceProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
Definition: dialogs.cpp:68
LONG_PTR LPARAM
Definition: windef.h:208
#define FreeLibrary(x)
Definition: compat.h:607
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
#define IDC_EDIT_PATH
Definition: shresdef.h:359
static void DestroyIconList(HWND hDlgCtrl, PPICK_ICON_CONTEXT pIconContext)
Definition: dialogs.cpp:87
BOOL WINAPI EnumResourceNamesW(HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam)
Definition: res.c:358
HMODULE hLibrary
Definition: odbccp32.c:12
#define EM_SETMODIFY
Definition: winuser.h:1995
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:339
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HMODULE hLibrary
Definition: dialog.c:549

Referenced by NoIconsInFile(), and PickIconProc().

◆ DrawIconOnOwnerDrawnButtons()

BOOL DrawIconOnOwnerDrawnButtons ( DRAWITEMSTRUCT pdis,
PLOGOFF_DLG_CONTEXT  pContext 
)

Definition at line 1103 of file dialogs.cpp.

1104 {
1105  BOOL bRet = FALSE;
1106  HDC hdcMem = NULL;
1107  HBITMAP hbmOld = NULL;
1108  int y = 0;
1109  RECT rect;
1110 
1111  hdcMem = CreateCompatibleDC(pdis->hDC);
1112  hbmOld = (HBITMAP)SelectObject(hdcMem, pContext->hImageStrip);
1113  rect = pdis->rcItem;
1114 
1115  /* Check the button ID for revelant bitmap to be used */
1116  switch (pdis->CtlID)
1117  {
1118  case IDC_LOG_OFF_BUTTON:
1119  {
1120  switch (pdis->itemAction)
1121  {
1122  case ODA_DRAWENTIRE:
1123  case ODA_FOCUS:
1124  case ODA_SELECT:
1125  {
1126  y = BUTTON_LOG_OFF;
1127  if (pdis->itemState & ODS_SELECTED)
1128  {
1130  }
1131  else if (pContext->bIsButtonHot[0] || (pdis->itemState & ODS_FOCUS))
1132  {
1134  }
1135  break;
1136  }
1137  }
1138  break;
1139  }
1140 
1142  {
1143  switch (pdis->itemAction)
1144  {
1145  case ODA_DRAWENTIRE:
1146  case ODA_FOCUS:
1147  case ODA_SELECT:
1148  {
1150  if (pdis->itemState & ODS_SELECTED)
1151  {
1153  }
1154  else if (pContext->bIsButtonHot[1] || (pdis->itemState & ODS_FOCUS))
1155  {
1157  }
1158 
1159  /*
1160  * Since switch user functionality isn't implemented yet therefore the button has been disabled
1161  * temporarily hence show the disabled state
1162  */
1163  else if (pdis->itemState & ODS_DISABLED)
1164  {
1166  }
1167  break;
1168  }
1169  }
1170  break;
1171  }
1172  }
1173 
1174  /* Draw it on the required button */
1175  bRet = BitBlt(pdis->hDC,
1176  (rect.right - rect.left - CX_BITMAP) / 2,
1177  (rect.bottom - rect.top - CY_BITMAP) / 2,
1179 
1180  SelectObject(hdcMem, hbmOld);
1181  DeleteDC(hdcMem);
1182 
1183  return bRet;
1184 }
#define CX_BITMAP
Definition: dialogs.cpp:1089
#define BUTTON_LOG_OFF_PRESSED
Definition: dialogs.cpp:1099
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define ODS_FOCUS
Definition: winuser.h:2524
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define ODA_FOCUS
Definition: winuser.h:2519
& rect
Definition: startmenu.cpp:1413
#define IDC_LOG_OFF_BUTTON
Definition: shresdef.h:479
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDC_SWITCH_USER_BUTTON
Definition: shresdef.h:480
#define BUTTON_SWITCH_USER_DISABLED
Definition: dialogs.cpp:1101
#define ODA_DRAWENTIRE
Definition: winuser.h:2517
#define ODS_DISABLED
Definition: winuser.h:2522
HBITMAP hImageStrip
Definition: dialogs.cpp:40
#define BUTTON_SWITCH_USER
Definition: dialogs.cpp:1095
#define BUTTON_LOG_OFF_FOCUSED
Definition: dialogs.cpp:1100
BOOL WINAPI DeleteDC(_In_ HDC)
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define BUTTON_LOG_OFF
Definition: dialogs.cpp:1098
#define BUTTON_SWITCH_USER_PRESSED
Definition: dialogs.cpp:1096
#define ODS_SELECTED
Definition: winuser.h:2520
static HBITMAP
Definition: button.c:44
#define CY_BITMAP
Definition: dialogs.cpp:1090
#define SRCCOPY
Definition: wingdi.h:332
#define ODA_SELECT
Definition: winuser.h:2518
HDC hdcMem
Definition: welcome.c:104
#define BUTTON_SWITCH_USER_FOCUSED
Definition: dialogs.cpp:1097
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
BOOL bIsButtonHot[2]
Definition: dialogs.cpp:39

Referenced by LogOffDialogProc().

◆ EnableOkButtonFromEditContents()

static void EnableOkButtonFromEditContents ( HWND  hwnd)
static

Definition at line 491 of file dialogs.cpp.

492 {
493  BOOL Enable = FALSE;
494  INT Length, n;
497  if (Length > 0)
498  {
499  PWCHAR psz = (PWCHAR)HeapAlloc(GetProcessHeap(), 0, (Length + 1) * sizeof(WCHAR));
500  if (psz)
501  {
502  GetWindowTextW(Edit, psz, Length + 1);
503  for (n = 0; n < Length && !Enable; ++n)
504  Enable = psz[n] != ' ';
505  HeapFree(GetProcessHeap(), 0, psz);
506  }
507  else
508  Enable = TRUE;
509  }
511 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_RUNDLG_EDITPATH
Definition: shresdef.h:335
#define IDOK
Definition: winuser.h:824
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define TRUE
Definition: types.h:120
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
GLdouble n
Definition: glext.h:7729
uint16_t * PWCHAR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI GetWindowTextLengthW(_In_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by RunDlgProc().

◆ EnablePrivilege()

static BOOL EnablePrivilege ( LPCWSTR  lpszPrivilegeName,
BOOL  bEnablePrivilege 
)
static

Definition at line 1028 of file dialogs.cpp.

1029 {
1030  BOOL Success;
1031  HANDLE hToken;
1033 
1036  &hToken);
1037  if (!Success) return Success;
1038 
1040  lpszPrivilegeName,
1041  &tp.Privileges[0].Luid);
1042  if (!Success) goto Quit;
1043 
1044  tp.PrivilegeCount = 1;
1045  tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
1046 
1047  Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
1048 
1049 Quit:
1050  CloseHandle(hToken);
1051  return Success;
1052 }
#define CloseHandle
Definition: compat.h:598
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2930
#define GetCurrentProcess()
Definition: compat.h:618
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
#define NULL
Definition: types.h:112
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876

Referenced by ExitWindowsDialog(), ExitWindowsDialog_backup(), and RestartDialogEx().

◆ EnumPickIconResourceProc()

BOOL CALLBACK EnumPickIconResourceProc ( HMODULE  hModule,
LPCWSTR  lpszType,
LPWSTR  lpszName,
LONG_PTR  lParam 
)

Definition at line 68 of file dialogs.cpp.

72 {
74  HWND hDlgCtrl = pIconContext->hDlgCtrl;
75 
76  if (IS_INTRESOURCE(lpszName))
77  lParam = LOWORD(lpszName);
78  else
79  lParam = -1;
80 
81  SendMessageW(hDlgCtrl, LB_ADDSTRING, 0, lParam);
82 
83  return TRUE;
84 }
#define LB_ADDSTRING
Definition: winuser.h:2013
#define TRUE
Definition: types.h:120
struct PICK_ICON_CONTEXT * PPICK_ICON_CONTEXT
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DoLoadIcons().

◆ ExitWindowsDialog()

void WINAPI ExitWindowsDialog ( HWND  hWndOwner)

Definition at line 1592 of file dialogs.cpp.

1593 {
1594  typedef DWORD (WINAPI *ShellShFunc)(HWND hParent, WCHAR *Username, BOOL bHideLogoff);
1595  HINSTANCE msginaDll = LoadLibraryW(L"msgina.dll");
1596 
1597  TRACE("(%p)\n", hWndOwner);
1598 
1599  CComPtr<IUnknown> fadeHandler;
1600  HWND parent;
1601  if (!CallShellDimScreen(&fadeHandler, &parent))
1602  parent = hWndOwner;
1603 
1604  /* If the DLL cannot be found for any reason, then it simply uses a
1605  dialog box to ask if the user wants to shut down the computer. */
1606  if (!msginaDll)
1607  {
1608  TRACE("Unable to load msgina.dll.\n");
1610  return;
1611  }
1612 
1613  ShellShFunc pShellShutdownDialog = (ShellShFunc)GetProcAddress(msginaDll, "ShellShutdownDialog");
1614 
1615  if (pShellShutdownDialog)
1616  {
1617  /* Actually call the function */
1618  DWORD returnValue = pShellShutdownDialog(parent, NULL, FALSE);
1619 
1620  switch (returnValue)
1621  {
1622  case 0x01: /* Log off user */
1623  {
1625  break;
1626  }
1627  case 0x02: /* Shut down */
1628  {
1629  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1631  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1632  break;
1633  }
1634  case 0x03: /* Install Updates/Shutdown (?) */
1635  {
1636  break;
1637  }
1638  case 0x04: /* Reboot */
1639  {
1640  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1642  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1643  break;
1644  }
1645  case 0x10: /* Sleep */
1646  {
1647  if (IsPwrSuspendAllowed())
1648  {
1649  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1651  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1652  }
1653  break;
1654  }
1655  case 0x40: /* Hibernate */
1656  {
1657  if (IsPwrHibernateAllowed())
1658  {
1659  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1661  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1662  }
1663  break;
1664  }
1665  /* If the option is any other value */
1666  default:
1667  break;
1668  }
1669  }
1670  else
1671  {
1672  /* If the function cannot be found, then revert to using the backup solution */
1673  TRACE("Unable to find the 'ShellShutdownDialog' function");
1675  }
1676 
1677  FreeLibrary(msginaDll);
1678 }
BOOLEAN WINAPI SetSuspendState(BOOLEAN Hibernate, BOOLEAN ForceCritical, BOOLEAN DisableWakeEvent)
Definition: powrprof.c:681
BOOLEAN WINAPI IsPwrSuspendAllowed(VOID)
Definition: powrprof.c:488
#define TRUE
Definition: types.h:120
#define EWX_REBOOT
Definition: winuser.h:633
#define DWORD
Definition: nt_native.h:44
#define EWX_LOGOFF
Definition: winuser.h:631
#define FALSE
Definition: types.h:117
#define EWX_SHUTDOWN
Definition: winuser.h:634
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LoadLibraryW(x)
Definition: compat.h:606
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
r parent
Definition: btrfs.c:2944
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Definition: dialogs.cpp:1028
static const WCHAR L[]
Definition: oid.c:1250
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:612
VOID ExitWindowsDialog_backup(HWND hWndOwner)
Definition: dialogs.cpp:1569
BOOL CallShellDimScreen(IUnknown **pUnknown, HWND *hWindow)
Definition: dialogs.cpp:1008
BOOLEAN WINAPI IsPwrHibernateAllowed(VOID)
Definition: powrprof.c:450

Referenced by CTrayWindow::DoExitWindows(), ShowExitWindowsDialog(), and CShellDispatch::ShutdownWindows().

◆ ExitWindowsDialog_backup()

VOID ExitWindowsDialog_backup ( HWND  hWndOwner)

Definition at line 1569 of file dialogs.cpp.

1570 {
1571  TRACE("(%p)\n", hWndOwner);
1572 
1574  {
1575  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1577  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1578  }
1579 }
#define TRUE
Definition: types.h:120
#define IDS_SHUTDOWN_PROMPT
Definition: shresdef.h:85
#define FALSE
Definition: types.h:117
#define EWX_SHUTDOWN
Definition: winuser.h:634
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL ConfirmDialog(HWND hWndOwner, UINT PromptId, UINT TitleId)
Definition: dialogs.cpp:995
#define IDS_SHUTDOWN_TITLE
Definition: shresdef.h:84
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Definition: dialogs.cpp:1028
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)

Referenced by ExitWindowsDialog().

◆ FancyLogoffOnInit()

static VOID FancyLogoffOnInit ( HWND  hwnd,
PLOGOFF_DLG_CONTEXT  pContext 
)
static

Definition at line 1353 of file dialogs.cpp.

1354 {
1355  HDC hdc = NULL;
1356  LONG lfHeight = NULL;
1357 
1358  hdc = GetDC(NULL);
1359  lfHeight = -MulDiv(FONT_POINT_SIZE, GetDeviceCaps(hdc, LOGPIXELSY), 72);
1360  ReleaseDC(NULL, hdc);
1361  pContext->hfFont = CreateFontW(lfHeight, 0, 0, 0, FW_MEDIUM, FALSE, 0, 0, 0, 0, 0, 0, 0, L"MS Shell Dlg");
1363 
1365 
1367 
1370 
1371  /* Gather old button func */
1373 
1374  /* Make buttons to remember pContext and subclass the buttons as well as set bIsButtonHot boolean flags to false */
1375  for (int i = 0; i < NUMBER_OF_BUTTONS; i++)
1376  {
1377  pContext->bIsButtonHot[i] = FALSE;
1380  }
1381 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
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)
INT_PTR CALLBACK OwnerDrawButtonSubclass(HWND hButton, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialogs.cpp:1186
HDC WINAPI GetDC(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
static HDC
Definition: imagelist.c:92
VOID CreateToolTipForButtons(int controlID, int detailID, HWND hDlg, int titleID)
Definition: dialogs.cpp:1250
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define IDS_LOG_OFF_TITLE
Definition: shresdef.h:325
#define IDS_SWITCH_USER_TITLE
Definition: shresdef.h:326
#define IDC_LOG_OFF_BUTTON
Definition: shresdef.h:479
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
WNDPROC OldButtonProc
Definition: dialogs.cpp:43
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define GWLP_USERDATA
Definition: treelist.c:63
#define IDC_SWITCH_USER_BUTTON
Definition: shresdef.h:480
#define DARK_GREY_COLOR
Definition: dialogs.cpp:1085
#define FW_MEDIUM
Definition: wingdi.h:374
#define FONT_POINT_SIZE
Definition: dialogs.cpp:1083
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HBITMAP hImageStrip
Definition: dialogs.cpp:40
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define NUMBER_OF_BUTTONS
Definition: dialogs.cpp:1092
#define shell32_hInstance
#define IDS_SWITCH_USER_DESC
Definition: shresdef.h:324
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
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define IDB_IMAGE_STRIP
Definition: resource.h:79
#define WM_SETFONT
Definition: winuser.h:1632
#define LOGPIXELSY
Definition: wingdi.h:718
#define SetWindowLongPtrW
Definition: winuser.h:5321
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_LOG_OFF_DESC
Definition: shresdef.h:323
BOOL bIsButtonHot[2]
Definition: dialogs.cpp:39
#define IDC_LOG_OFF_TEXT_STATIC
Definition: shresdef.h:483

Referenced by LogOffDialogProc().

◆ FillList()

static void FillList ( HWND  hCb,
LPWSTR  pszLatest,
UINT  cchStr,
BOOL  fShowDefault 
)
static

Definition at line 764 of file dialogs.cpp.

765 {
766  HKEY hkey;
767  WCHAR *pszList = NULL, *pszCmd = NULL, *pszTmp = NULL, cMatch = 0, cMax = 0x60;
768  WCHAR szIndex[2] = L"-";
769  UINT cchLatest;
770  DWORD dwType, icList = 0, icCmd = 0;
771  LRESULT lRet;
772  UINT Nix;
773 
774  /*
775  * Retrieve the string length of pszLatest and check whether its buffer size
776  * (cchStr in number of characters) is large enough to add the terminating "\\1"
777  * (and the NULL character).
778  */
779  if (pszLatest)
780  {
781  cchLatest = wcslen(pszLatest);
782  if (cchStr < cchLatest + 2 + 1)
783  {
784  TRACE("pszLatest buffer is not large enough (%d) to hold the MRU terminator.\n", cchStr);
785  return;
786  }
787  }
788  else
789  {
790  cchStr = 0;
791  }
792 
793  SendMessageW(hCb, CB_RESETCONTENT, 0, 0);
794 
796  L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU",
798  if (lRet != ERROR_SUCCESS)
799  {
800  TRACE("Unable to open or create the RunMRU key, error %d\n", GetLastError());
801  return;
802  }
803 
804  lRet = RegQueryValueExW(hkey, L"MRUList", NULL, &dwType, NULL, &icList);
805  if (lRet == ERROR_SUCCESS && dwType == REG_SZ && icList > sizeof(WCHAR))
806  {
807  pszList = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, icList);
808  if (!pszList)
809  {
810  TRACE("HeapAlloc failed to allocate %d bytes\n", icList);
811  goto Continue;
812  }
813  pszList[0] = L'\0';
814 
815  lRet = RegQueryValueExW(hkey, L"MRUList", NULL, NULL, (LPBYTE)pszList, &icList);
816  if (lRet != ERROR_SUCCESS)
817  {
818  TRACE("Unable to grab MRUList, error %d\n", GetLastError());
819  pszList[0] = L'\0';
820  }
821  }
822  else
823  {
824 Continue:
825  icList = sizeof(WCHAR);
826  pszList = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, icList);
827  if (!pszList)
828  {
829  TRACE("HeapAlloc failed to allocate %d bytes\n", icList);
830  RegCloseKey(hkey);
831  return;
832  }
833  pszList[0] = L'\0';
834  }
835 
836  /* Convert the number of bytes from MRUList into number of characters (== number of indices) */
837  icList /= sizeof(WCHAR);
838 
839  for (Nix = 0; Nix < icList - 1; Nix++)
840  {
841  if (pszList[Nix] > cMax)
842  cMax = pszList[Nix];
843 
844  szIndex[0] = pszList[Nix];
845 
846  lRet = RegQueryValueExW(hkey, szIndex, NULL, &dwType, NULL, &icCmd);
847  if (lRet != ERROR_SUCCESS || dwType != REG_SZ)
848  {
849  TRACE("Unable to grab size of index, error %d\n", GetLastError());
850  continue;
851  }
852 
853  if (pszCmd)
854  {
855  pszTmp = (WCHAR*)HeapReAlloc(GetProcessHeap(), 0, pszCmd, icCmd);
856  if (!pszTmp)
857  {
858  TRACE("HeapReAlloc failed to reallocate %d bytes\n", icCmd);
859  continue;
860  }
861  pszCmd = pszTmp;
862  }
863  else
864  {
865  pszCmd = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, icCmd);
866  if (!pszCmd)
867  {
868  TRACE("HeapAlloc failed to allocate %d bytes\n", icCmd);
869  continue;
870  }
871  }
872 
873  lRet = RegQueryValueExW(hkey, szIndex, NULL, NULL, (LPBYTE)pszCmd, &icCmd);
874  if (lRet != ERROR_SUCCESS)
875  {
876  TRACE("Unable to grab index, error %d\n", GetLastError());
877  continue;
878  }
879 
880  /*
881  * Generally the command string will end up with "\\1".
882  * Find the last backslash in the string and NULL-terminate.
883  * Windows does not seem to check for what comes next, so that
884  * a command of the form:
885  * c:\\my_dir\\myfile.exe
886  * will be cut just after "my_dir", whereas a command of the form:
887  * c:\\my_dir\\myfile.exe\\1
888  * will be cut just after "myfile.exe".
889  */
890  pszTmp = wcsrchr(pszCmd, L'\\');
891  if (pszTmp)
892  *pszTmp = L'\0';
893 
894  /*
895  * In the following we try to add pszLatest to the MRU list.
896  * We suppose that our caller has already correctly allocated
897  * the string with enough space for us to append a "\\1".
898  *
899  * FIXME: TODO! (At the moment we don't append it!)
900  */
901 
902  if (pszLatest)
903  {
904  if (wcsicmp(pszCmd, pszLatest) == 0)
905  {
906  SendMessageW(hCb, CB_INSERTSTRING, 0, (LPARAM)pszCmd);
907  SetWindowTextW(hCb, pszCmd);
908  SendMessageW(hCb, CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
909 
910  cMatch = pszList[Nix];
911  memmove(&pszList[1], pszList, Nix * sizeof(WCHAR));
912  pszList[0] = cMatch;
913  continue;
914  }
915  }
916 
917  if (icList - 1 != 26 || icList - 2 != Nix || cMatch || pszLatest == NULL)
918  {
919  SendMessageW(hCb, CB_ADDSTRING, 0, (LPARAM)pszCmd);
920  if (!Nix && fShowDefault)
921  {
922  SetWindowTextW(hCb, pszCmd);
923  SendMessageW(hCb, CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
924  }
925  }
926  else
927  {
928  SendMessageW(hCb, CB_INSERTSTRING, 0, (LPARAM)pszLatest);
929  SetWindowTextW(hCb, pszLatest);
930  SendMessageW(hCb, CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
931 
932  cMatch = pszList[Nix];
933  memmove(&pszList[1], pszList, Nix * sizeof(WCHAR));
934  pszList[0] = cMatch;
935  szIndex[0] = cMatch;
936 
937  wcscpy(&pszLatest[cchLatest], L"\\1");
938  RegSetValueExW(hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, (cchLatest + 2 + 1) * sizeof(WCHAR));
939  pszLatest[cchLatest] = L'\0';
940  }
941  }
942 
943  if (!cMatch && pszLatest != NULL)
944  {
945  SendMessageW(hCb, CB_INSERTSTRING, 0, (LPARAM)pszLatest);
946  SetWindowTextW(hCb, pszLatest);
947  SendMessageW(hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1));
948 
949  cMatch = ++cMax;
950 
951  if (pszList)
952  {
953  pszTmp = (WCHAR*)HeapReAlloc(GetProcessHeap(), 0, pszList, (++icList) * sizeof(WCHAR));
954  if (!pszTmp)
955  {
956  TRACE("HeapReAlloc failed to reallocate enough bytes\n");
957  goto Cleanup;
958  }
959  pszList = pszTmp;
960  }
961  else
962  {
963  pszList = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (++icList) * sizeof(WCHAR));
964  if (!pszList)
965  {
966  TRACE("HeapAlloc failed to allocate enough bytes\n");
967  goto Cleanup;
968  }
969  }
970 
971  memmove(&pszList[1], pszList, (icList - 1) * sizeof(WCHAR));
972  pszList[0] = cMatch;
973  szIndex[0] = cMatch;
974 
975  wcscpy(&pszLatest[cchLatest], L"\\1");
976  RegSetValueExW(hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, (cchLatest + 2 + 1) * sizeof(WCHAR));
977  pszLatest[cchLatest] = L'\0';
978  }
979 
980 Cleanup:
981  RegSetValueExW(hkey, L"MRUList", 0, REG_SZ, (LPBYTE)pszList, (wcslen(pszList) + 1) * sizeof(WCHAR));
982 
983  HeapFree(GetProcessHeap(), 0, pszCmd);
984  HeapFree(GetProcessHeap(), 0, pszList);
985 
986  RegCloseKey(hkey);
987 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ERROR_SUCCESS
Definition: deptool.c:10
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_INSERTSTRING
Definition: winuser.h:1939
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_RESETCONTENT
Definition: winuser.h:1941
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define wcsicmp
Definition: compat.h:15
volatile int Continue
Definition: gdblib.c:102
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define wcsrchr
Definition: compat.h:16
static const WCHAR Cleanup[]
Definition: register.c:80
#define CB_SETEDITSEL
Definition: winuser.h:1945
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HeapReAlloc
Definition: compat.h:593
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LONG_PTR LRESULT
Definition: windef.h:209
#define HeapFree(x, y, z)
Definition: compat.h:594
#define REG_SZ
Definition: layer.c:22

Referenced by RunDlgProc().

◆ IsFriendlyUIActive()

static BOOL IsFriendlyUIActive ( VOID  )
static

Definition at line 1279 of file dialogs.cpp.

1280 {
1281  DWORD dwType = 0, dwValue = 0, dwSize = 0;
1282  HKEY hKey = NULL;
1283  LONG lRet = 0;
1284 
1286  L"SYSTEM\\CurrentControlSet\\Control\\Windows",
1287  0,
1289  &hKey);
1290  if (lRet != ERROR_SUCCESS)
1291  return FALSE;
1292 
1293  /* First check an optional ReactOS specific override, that Windows does not check.
1294  We use this to allow users pairing 'Server'-configuration with FriendlyLogoff.
1295  Otherwise users would have to change CSDVersion or LogonType (side-effects AppCompat) */
1296  dwValue = 0;
1297  dwSize = sizeof(dwValue);
1298  lRet = RegQueryValueExW(hKey,
1299  L"EnforceFriendlyLogoff",
1300  NULL,
1301  &dwType,
1302  (LPBYTE)&dwValue,
1303  &dwSize);
1304 
1305  if (lRet == ERROR_SUCCESS && dwType == REG_DWORD && dwValue != FRIENDLY_LOGOFF_IS_NOT_ENFORCED)
1306  {
1307  RegCloseKey(hKey);
1308  return TRUE;
1309  }
1310 
1311  /* Check product version number */
1312  dwValue = 0;
1313  dwSize = sizeof(dwValue);
1314  lRet = RegQueryValueExW(hKey,
1315  L"CSDVersion",
1316  NULL,
1317  &dwType,
1318  (LPBYTE)&dwValue,
1319  &dwSize);
1320  RegCloseKey(hKey);
1321 
1322  if (lRet != ERROR_SUCCESS || dwType != REG_DWORD || dwValue != IS_PRODUCT_VERSION_WORKSTATION)
1323  {
1324  /* Allow Friendly UI only on Workstation */
1325  return FALSE;
1326  }
1327 
1328  /* Check LogonType value */
1330  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
1331  0,
1333  &hKey);
1334  if (lRet != ERROR_SUCCESS)
1335  return FALSE;
1336 
1337  dwValue = 0;
1338  dwSize = sizeof(dwValue);
1339  lRet = RegQueryValueExW(hKey,
1340  L"LogonType",
1341  NULL,
1342  &dwType,
1343  (LPBYTE)&dwValue,
1344  &dwSize);
1345  RegCloseKey(hKey);
1346 
1347  if (lRet != ERROR_SUCCESS || dwType != REG_DWORD)
1348  return FALSE;
1349 
1350  return (dwValue != 0);
1351 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define IS_PRODUCT_VERSION_WORKSTATION
Definition: dialogs.cpp:1080
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define FRIENDLY_LOGOFF_IS_NOT_ENFORCED
Definition: dialogs.cpp:1081
#define REG_DWORD
Definition: sdbapi.c:596
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by LogoffWindowsDialog().

◆ LogOffDialogProc()

INT_PTR CALLBACK LogOffDialogProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1389 of file dialogs.cpp.

1390 {
1392  PLOGOFF_DLG_CONTEXT pContext;
1394 
1395  switch (uMsg)
1396  {
1397  case WM_INITDIALOG:
1398  {
1399  pContext = (PLOGOFF_DLG_CONTEXT)lParam;
1401 
1402  if (pContext->bFriendlyUI)
1403  FancyLogoffOnInit(hwnd, pContext);
1404  return TRUE;
1405  }
1406 
1407  case WM_CLOSE:
1410  break;
1411 
1412  /*
1413  * If the user deactivates the log off dialog (it loses its focus
1414  * while the dialog is not being closed), then destroy the dialog
1415  * box.
1416  */
1417  case WM_ACTIVATE:
1418  {
1419  if (LOWORD(wParam) == WA_INACTIVE)
1420  {
1422  PostQuitMessage(0);
1423  }
1424  return FALSE;
1425  }
1426 
1427  case WM_COMMAND:
1428  switch (LOWORD(wParam))
1429  {
1430  case IDC_LOG_OFF_BUTTON:
1431  case IDOK:
1433  break;
1434 
1435  case IDCANCEL:
1438  break;
1439  }
1440  break;
1441 
1442  case WM_DESTROY:
1443  DeleteObject(pContext->hBrush);
1444  DeleteObject(pContext->hImageStrip);
1445  DeleteObject(pContext->hfFont);
1446 
1447  /* Remove the subclass from the buttons */
1448  for (int i = 0; i < NUMBER_OF_BUTTONS; i++)
1449  {
1451  }
1452  return TRUE;
1453 
1454  case WM_CTLCOLORSTATIC:
1455  {
1456  /* Either make background transparent or fill it with color for required static controls */
1457  HDC hdcStatic = (HDC)wParam;
1458  UINT StaticID = (UINT)GetWindowLongPtrW((HWND)lParam, GWL_ID);
1459 
1460  switch (StaticID)
1461  {
1463  SetTextColor(hdcStatic, DARK_GREY_COLOR);
1464  SetBkMode(hdcStatic, TRANSPARENT);
1466 
1467  case IDC_LOG_OFF_STATIC:
1469  SetTextColor(hdcStatic, LIGHT_GREY_COLOR);
1470  SetBkMode(hdcStatic, TRANSPARENT);
1471  return (LONG_PTR)pContext->hBrush;
1472  }
1473  return FALSE;
1474  }
1475  break;
1476 
1477  case WM_DRAWITEM:
1478  {
1479  /* Draw bitmaps on required buttons */
1480  switch (pdis->CtlID)
1481  {
1482  case IDC_LOG_OFF_BUTTON:
1484  return DrawIconOnOwnerDrawnButtons(pdis, pContext);
1485  }
1486  }
1487  break;
1488 
1489  default:
1490  break;
1491  }
1492  return FALSE;
1493 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define IDC_LOG_OFF_STATIC
Definition: shresdef.h:481
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDOK
Definition: winuser.h:824
struct LOGOFF_DLG_CONTEXT * PLOGOFF_DLG_CONTEXT
#define TRUE
Definition: types.h:120
#define GWL_ID
Definition: winuser.h:853
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
static HDC
Definition: imagelist.c:92
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define GetWindowLongPtrW
Definition: winuser.h:4804
int32_t INT_PTR
Definition: typedefs.h:64
BOOL WINAPI DestroyWindow(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
#define EWX_LOGOFF
Definition: winuser.h:631
#define IDC_LOG_OFF_BUTTON
Definition: shresdef.h:479
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1034
#define FALSE
Definition: types.h:117
WNDPROC OldButtonProc
Definition: dialogs.cpp:43
static VOID FancyLogoffOnInit(HWND hwnd, PLOGOFF_DLG_CONTEXT pContext)
Definition: dialogs.cpp:1353
#define TRANSPARENT
Definition: wingdi.h:949
#define GWLP_USERDATA
Definition: treelist.c:63
#define IDC_SWITCH_USER_BUTTON
Definition: shresdef.h:480
#define DARK_GREY_COLOR
Definition: dialogs.cpp:1085
#define IDC_SWITCH_USER_STATIC
Definition: shresdef.h:482
#define WM_DESTROY
Definition: winuser.h:1591
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HBITMAP hImageStrip
Definition: dialogs.cpp:40
#define WM_CLOSE
Definition: winuser.h:1603
#define HOLLOW_BRUSH
Definition: wingdi.h:898
#define LIGHT_GREY_COLOR
Definition: dialogs.cpp:1086
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define GWLP_WNDPROC
Definition: treelist.c:66
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
BOOL DrawIconOnOwnerDrawnButtons(DRAWITEMSTRUCT *pdis, PLOGOFF_DLG_CONTEXT pContext)
Definition: dialogs.cpp:1103
#define NUMBER_OF_BUTTONS
Definition: dialogs.cpp:1092
#define WM_ACTIVATE
Definition: winuser.h:1594
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
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define WM_DRAWITEM
Definition: winuser.h:1627
#define SetWindowLongPtrW
Definition: winuser.h:5321
#define WA_INACTIVE
Definition: winuser.h:2597
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define IDC_LOG_OFF_TEXT_STATIC
Definition: shresdef.h:483

Referenced by LogoffWindowsDialog().

◆ LogoffWindowsDialog()

EXTERN_C int WINAPI LogoffWindowsDialog ( HWND  hWndOwner)

Definition at line 1499 of file dialogs.cpp.

1500 {
1501  CComPtr<IUnknown> fadeHandler;
1502  BOOL bIsAltKeyPressed = FALSE;
1503  MSG Msg;
1504  HWND parent = NULL;
1505  HWND hWndChild = NULL;
1506  WCHAR szBuffer[30];
1507  DWORD LogoffDialogID = IDD_LOG_OFF;
1509 
1510  if (!CallShellDimScreen(&fadeHandler, &parent))
1511  parent = hWndOwner;
1512 
1513  Context.bFriendlyUI = IsFriendlyUIActive();
1514 
1515  if (Context.bFriendlyUI)
1516  {
1517  LogoffDialogID = IDD_LOG_OFF_FANCY;
1518  }
1519 
1522 
1523  /* Detect either Alt key has been pressed */
1524  while (GetMessageW(&Msg, NULL, 0, 0))
1525  {
1527  {
1530  }
1531 
1532  switch (Msg.message)
1533  {
1534  case WM_SYSKEYDOWN:
1535  {
1536  /* If the Alt key has been pressed once, add prefix to static controls */
1537  if (Msg.wParam == VK_MENU && !bIsAltKeyPressed && Context.bFriendlyUI)
1538  {
1539  for (int i = 0; i < NUMBER_OF_BUTTONS; i++)
1540  {
1541  GetDlgItemTextW(hWndChild, IDC_LOG_OFF_BUTTON + i, szBuffer, _countof(szBuffer));
1543  }
1544  bIsAltKeyPressed = TRUE;
1545  }
1546  }
1547  break;
1548  }
1549  }
1550  return 0;
1551 }
#define IDC_LOG_OFF_STATIC
Definition: shresdef.h:481
#define IDD_LOG_OFF_FANCY
Definition: shresdef.h:519
BOOL WINAPI TranslateMessage(_In_ const MSG *)
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define TRUE
Definition: types.h:120
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static BOOL IsFriendlyUIActive(VOID)
Definition: dialogs.cpp:1279
#define VK_MENU
Definition: winuser.h:2179
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDC_LOG_OFF_BUTTON
Definition: shresdef.h:479
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
r parent
Definition: btrfs.c:2944
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
unsigned long DWORD
Definition: ntddk_ex.h:95
INT_PTR CALLBACK LogOffDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialogs.cpp:1389
#define NUMBER_OF_BUTTONS
Definition: dialogs.cpp:1092
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define shell32_hInstance
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 NULL
Definition: types.h:112
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
struct @1623 Msg[]
struct tagContext Context
Definition: acpixf.h:1034
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDD_LOG_OFF
Definition: shresdef.h:513
HWND hWndChild[NUM_TABS]
Definition: main.h:75
BOOL CallShellDimScreen(IUnknown **pUnknown, HWND *hWindow)
Definition: dialogs.cpp:1008
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)

Referenced by CTrayWindow::HandleCommand(), and StartMenuHandler::ShowLogoffDialog().

◆ NoIconsInFile()

static void NoIconsInFile ( HWND  hwndDlg,
PPICK_ICON_CONTEXT  pIconContext 
)
static

Definition at line 169 of file dialogs.cpp.

170 {
171  // Show an error message
172  CStringW strText, strTitle(MAKEINTRESOURCEW(IDS_PICK_ICON_TITLE));
173  strText.Format(IDS_NO_ICONS, pIconContext->szPath);
174  MessageBoxW(hwndDlg, strText, strTitle, MB_ICONWARNING);
175 
176  // Load the default icons
177  DoLoadIcons(hwndDlg, pIconContext, s_pszDefaultPath);
178 }
#define IDS_PICK_ICON_TITLE
Definition: shresdef.h:360
static BOOL DoLoadIcons(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile)
Definition: dialogs.cpp:104
#define MB_ICONWARNING
Definition: winuser.h:780
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define IDS_NO_ICONS
Definition: shresdef.h:309
static const LPCWSTR s_pszDefaultPath
Definition: dialogs.cpp:167
CAtlStringW CStringW
Definition: atlstr.h:130
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by PickIconProc().

◆ OwnerDrawButtonSubclass()

INT_PTR CALLBACK OwnerDrawButtonSubclass ( HWND  hButton,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1186 of file dialogs.cpp.

1187 {
1188  PLOGOFF_DLG_CONTEXT pContext;
1189  pContext = (PLOGOFF_DLG_CONTEXT)GetWindowLongPtrW(hButton, GWLP_USERDATA);
1190 
1191  int buttonID = GetDlgCtrlID(hButton);
1192 
1193  switch (uMsg)
1194  {
1195  case WM_MOUSEMOVE:
1196  {
1197  HWND hwndTarget = NULL;
1199 
1200  if (GetCapture() != hButton)
1201  {
1202  SetCapture(hButton);
1203  if (buttonID == IDC_LOG_OFF_BUTTON)
1204  {
1205  pContext->bIsButtonHot[0] = TRUE;
1206  }
1207  else if (buttonID == IDC_SWITCH_USER_BUTTON)
1208  {
1209  pContext->bIsButtonHot[1] = TRUE;
1210  }
1212  }
1213 
1214  ClientToScreen(hButton, &pt);
1215  hwndTarget = WindowFromPoint(pt);
1216 
1217  if (hwndTarget != hButton)
1218  {
1219  ReleaseCapture();
1220  if (buttonID == IDC_LOG_OFF_BUTTON)
1221  {
1222  pContext->bIsButtonHot[0] = FALSE;
1223  }
1224  else if (buttonID == IDC_SWITCH_USER_BUTTON)
1225  {
1226  pContext->bIsButtonHot[1] = FALSE;
1227  }
1228  }
1229  InvalidateRect(hButton, NULL, FALSE);
1230  break;
1231  }
1232 
1233  /* Whenever one of the buttons gets the keyboard focus, set it as default button */
1234  case WM_SETFOCUS:
1235  {
1236  SendMessageW(GetParent(hButton), DM_SETDEFID, buttonID, 0);
1237  break;
1238  }
1239 
1240  /* Otherwise, set IDCANCEL as default button */
1241  case WM_KILLFOCUS:
1242  {
1243  SendMessageW(GetParent(hButton), DM_SETDEFID, IDCANCEL, 0);
1244  break;
1245  }
1246  }
1247  return CallWindowProcW(pContext->OldButtonProc, hButton, uMsg, wParam, lParam);
1248 }
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
struct LOGOFF_DLG_CONTEXT * PLOGOFF_DLG_CONTEXT
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define DM_SETDEFID
Definition: winuser.h:2081
#define GetWindowLongPtrW
Definition: winuser.h:4804
WPARAM wParam
Definition: combotst.c:138
#define IDC_LOG_OFF_BUTTON
Definition: shresdef.h:479
int WINAPI GetDlgCtrlID(_In_ HWND)
#define FALSE
Definition: types.h:117
WNDPROC OldButtonProc
Definition: dialogs.cpp:43
HWND WINAPI GetCapture(void)
Definition: message.c:2880
#define GWLP_USERDATA
Definition: treelist.c:63
#define IDC_SWITCH_USER_BUTTON
Definition: shresdef.h:480
#define IDC_HAND
Definition: winuser.h:693
#define WM_KILLFOCUS
Definition: winuser.h:1596
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI SetCapture(_In_ HWND hWnd)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define NULL
Definition: types.h:112
HWND WINAPI WindowFromPoint(_In_ POINT)
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WM_SETFOCUS
Definition: winuser.h:1595
#define IDCANCEL
Definition: winuser.h:825
LPARAM lParam
Definition: combotst.c:139
BOOL bIsButtonHot[2]
Definition: dialogs.cpp:39

Referenced by FancyLogoffOnInit().

◆ PickIconDlg()

BOOL WINAPI PickIconDlg ( HWND  hWndOwner,
LPWSTR  lpstrFile,
UINT  nMaxFile,
INT lpdwIconIndex 
)

Definition at line 364 of file dialogs.cpp.

369 {
370  int res;
371  WCHAR szExpandedPath[MAX_PATH];
372 
373  // Initialize the dialog
374  PICK_ICON_CONTEXT IconContext = { NULL };
375  IconContext.Index = *lpdwIconIndex;
376  StringCchCopyW(IconContext.szPath, _countof(IconContext.szPath), lpstrFile);
377  ExpandEnvironmentStringsW(lpstrFile, szExpandedPath, _countof(szExpandedPath));
378 
379  if (!szExpandedPath[0] ||
380  GetFileAttributesW(szExpandedPath) == INVALID_FILE_ATTRIBUTES)
381  {
382  if (szExpandedPath[0])
383  {
384  // No such file
385  CStringW strText, strTitle(MAKEINTRESOURCEW(IDS_PICK_ICON_TITLE));
386  strText.Format(IDS_FILE_NOT_FOUND, lpstrFile);
387  MessageBoxW(hWndOwner, strText, strTitle, MB_ICONWARNING);
388  }
389 
390  // Set the default value
391  StringCchCopyW(IconContext.szPath, _countof(IconContext.szPath), s_pszDefaultPath);
392  }
393 
394  // Show the dialog
396  if (res)
397  {
398  // Store the selected icon
399  StringCchCopyW(lpstrFile, nMaxFile, IconContext.szPath);
400  *lpdwIconIndex = IconContext.Index;
401  }
402 
403  return res;
404 }
#define IDS_PICK_ICON_TITLE
Definition: shresdef.h:360
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MB_ICONWARNING
Definition: winuser.h:780
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_PICK_ICON
Definition: shresdef.h:356
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
WCHAR szPath[MAX_PATH]
Definition: dialogs.cpp:62
#define IDS_FILE_NOT_FOUND
Definition: shresdef.h:310
#define shell32_hInstance
#define NULL
Definition: types.h:112
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
static const LPCWSTR s_pszDefaultPath
Definition: dialogs.cpp:167
INT_PTR CALLBACK PickIconProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialogs.cpp:188
GLuint res
Definition: glext.h:9613
CAtlStringW CStringW
Definition: atlstr.h:130
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by EditTypeDlg_OnChangeIcon(), CShellLink::OnCommand(), and CFileDefExt::OnFolderCustChangeIcon().

◆ PickIconProc()

INT_PTR CALLBACK PickIconProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 188 of file dialogs.cpp.

193 {
194  LPMEASUREITEMSTRUCT lpmis;
195  LPDRAWITEMSTRUCT lpdis;
196  HICON hIcon;
197  INT index, count;
198  WCHAR szText[MAX_PATH], szFilter[100];
199  CStringW strTitle;
201 
203 
204  switch(uMsg)
205  {
206  case WM_INITDIALOG:
207  {
208  pIconContext = (PPICK_ICON_CONTEXT)lParam;
209  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pIconContext);
210  pIconContext->hDlgCtrl = GetDlgItem(hwndDlg, IDC_PICKICON_LIST);
211 
212  SendMessageW(pIconContext->hDlgCtrl, LB_SETCOLUMNWIDTH, CX_ITEM, 0);
213 
214  // Load the icons
215  if (!DoLoadIcons(hwndDlg, pIconContext, pIconContext->szPath))
216  NoIconsInFile(hwndDlg, pIconContext);
217 
218  // Set the selection
219  count = SendMessageW(pIconContext->hDlgCtrl, LB_GETCOUNT, 0, 0);
220  if (count != LB_ERR)
221  {
222  if (pIconContext->Index < 0)
223  {
224  // A negative value will be interpreted as a negated resource ID.
225  LPARAM lParam = -pIconContext->Index;
226  pIconContext->Index = (INT)SendMessageW(pIconContext->hDlgCtrl, LB_FINDSTRINGEXACT, -1, lParam);
227  }
228 
229  if (pIconContext->Index < 0 || count <= pIconContext->Index)
230  pIconContext->Index = 0;
231 
232  SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, pIconContext->Index, 0);
233  SendMessageW(pIconContext->hDlgCtrl, LB_SETTOPINDEX, pIconContext->Index, 0);
234  }
235 
237  return TRUE;
238  }
239 
240  case WM_DESTROY:
241  {
242  DestroyIconList(pIconContext->hDlgCtrl, pIconContext);
243  delete[] pIconContext->phIcons;
244 
245  if (pIconContext->hLibrary)
246  FreeLibrary(pIconContext->hLibrary);
247  break;
248  }
249 
250  case WM_COMMAND:
251  switch(LOWORD(wParam))
252  {
253  case IDOK:
254  {
255  /* Check whether the path edit control has been modified; if so load the icons instead of validating */
256  if (SendDlgItemMessage(hwndDlg, IDC_EDIT_PATH, EM_GETMODIFY, 0, 0))
257  {
258  /* Reset the edit control's modification flag and retrieve the text */
261 
262  // Load the icons
263  if (!DoLoadIcons(hwndDlg, pIconContext, szText))
264  NoIconsInFile(hwndDlg, pIconContext);
265 
266  // Set the selection
267  SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
268  break;
269  }
270 
271  /* The path edit control has not been modified, return the selection */
272  pIconContext->Index = (INT)SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0);
273  GetDlgItemTextW(hwndDlg, IDC_EDIT_PATH, pIconContext->szPath, _countof(pIconContext->szPath));
274  EndDialog(hwndDlg, 1);
275  break;
276  }
277 
278  case IDCANCEL:
279  EndDialog(hwndDlg, 0);
280  break;
281 
282  case IDC_PICKICON_LIST:
283  switch (HIWORD(wParam))
284  {
285  case LBN_SELCHANGE:
287  break;
288 
289  case LBN_DBLCLK:
290  SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDOK, 0), 0);
291  break;
292  }
293  break;
294 
295  case IDC_BUTTON_PATH:
296  {
297  // Choose the module path
298  szText[0] = 0;
299  szFilter[0] = 0;
300  ZeroMemory(&ofn, sizeof(ofn));
301  ofn.lStructSize = sizeof(ofn);
302  ofn.hwndOwner = hwndDlg;
303  ofn.lpstrFile = szText;
305  strTitle.LoadString(IDS_PICK_ICON_TITLE);
306  ofn.lpstrTitle = strTitle;
309  if (!GetOpenFileNameW(&ofn))
310  break;
311 
312  // Load the icons
313  if (!DoLoadIcons(hwndDlg, pIconContext, szText))
314  NoIconsInFile(hwndDlg, pIconContext);
315 
316  // Set the selection
317  SendMessageW(pIconContext->hDlgCtrl, LB_SETCURSEL, 0, 0);
318  break;
319  }
320 
321  default:
322  break;
323  }
324  break;
325 
326  case WM_MEASUREITEM:
327  lpmis = (LPMEASUREITEMSTRUCT)lParam;
328  lpmis->itemHeight = CY_ITEM;
329  return TRUE;
330 
331  case WM_DRAWITEM:
332  {
333  lpdis = (LPDRAWITEMSTRUCT)lParam;
334  if (lpdis->itemID == (UINT)-1)
335  break;
336  switch (lpdis->itemAction)
337  {
338  case ODA_SELECT:
339  case ODA_DRAWENTIRE:
340  {
341  index = SendMessageW(pIconContext->hDlgCtrl, LB_GETCURSEL, 0, 0);
342  hIcon = pIconContext->phIcons[lpdis->itemID];
343 
344  if (lpdis->itemID == (UINT)index)
345  FillRect(lpdis->hDC, &lpdis->rcItem, (HBRUSH)(COLOR_HIGHLIGHT + 1));
346  else
347  FillRect(lpdis->hDC, &lpdis->rcItem, (HBRUSH)(COLOR_WINDOW + 1));
348 
349  // Centering
350  INT x = lpdis->rcItem.left + (CX_ITEM - CX_ICON) / 2;
351  INT y = lpdis->rcItem.top + (CY_ITEM - CY_ICON) / 2;
352 
353  DrawIconEx(lpdis->hDC, x, y, hIcon, 0, 0, 0, NULL, DI_NORMAL);
354  break;
355  }
356  }
357  return TRUE;
358  }
359  }
360 
361  return FALSE;
362 }
#define LB_SETCURSEL
Definition: winuser.h:2045
struct tagMEASUREITEMSTRUCT * LPMEASUREITEMSTRUCT
#define IDS_PICK_ICON_TITLE
Definition: shresdef.h:360
static HICON
Definition: imagelist.c:84
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define IDOK
Definition: winuser.h:824
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_SETCOLUMNWIDTH
Definition: winuser.h:2043
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
HWND hwndOwner
Definition: commdlg.h:330
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
static BOOL DoLoadIcons(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext, LPCWSTR pszFile)
Definition: dialogs.cpp:104
#define INT
Definition: polytest.cpp:20
LONG top
Definition: windef.h:307
OPENFILENAME ofn
Definition: main.cpp:37
#define ZeroMemory
Definition: winbase.h:1664
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SendDlgItemMessage
Definition: winuser.h:5817
LONG left
Definition: windef.h:306
#define LBN_SELCHANGE
Definition: winuser.h:2057
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define COLOR_WINDOW
Definition: winuser.h:908
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
DWORD nMaxFile
Definition: commdlg.h:337
#define IDC_PICKICON_LIST
Definition: shresdef.h:357
struct PICK_ICON_CONTEXT * PPICK_ICON_CONTEXT
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
#define LB_ERR
Definition: winuser.h:2407
static void NoIconsInFile(HWND hwndDlg, PPICK_ICON_CONTEXT pIconContext)
Definition: dialogs.cpp:169
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4677
#define IDS_PICK_ICON_FILTER
Definition: shresdef.h:361
LONG_PTR LPARAM
Definition: windef.h:208
LPTSTR szFilter
Definition: mplay32.c:30
#define CX_ITEM
Definition: dialogs.cpp:185
GLuint index
Definition: glext.h:6031
#define LB_GETCOUNT
Definition: winuser.h:2020
#define CY_ICON
Definition: dialogs.cpp:182
#define WM_DESTROY
Definition: winuser.h:1591
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
Definition: autocomp.cpp:191
#define IDC_BUTTON_PATH
Definition: shresdef.h:358
#define ODA_DRAWENTIRE
Definition: winuser.h:2517
#define FreeLibrary(x)
Definition: compat.h:607
#define LB_SETTOPINDEX
Definition: winuser.h:2052
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
_In_ WDFCOLLECTION _In_ ULONG Index
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
DWORD lStructSize
Definition: commdlg.h:329
#define EM_GETMODIFY
Definition: winuser.h:1976
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define WM_MEASUREITEM
Definition: winuser.h:1628
#define IDC_EDIT_PATH
Definition: shresdef.h:359
#define LBN_DBLCLK
Definition: winuser.h:2053
static void DestroyIconList(HWND hDlgCtrl, PPICK_ICON_CONTEXT pIconContext)
Definition: dialogs.cpp:87
#define index(s, c)
Definition: various.h:29
#define DWLP_USER
Definition: winuser.h:866
#define DI_NORMAL
Definition: wingdi.h:72
#define EM_SETMODIFY
Definition: winuser.h:1995
#define WM_COMMAND
Definition: winuser.h:1722
#define CX_ICON
Definition: dialogs.cpp:181
#define shell32_hInstance
LPSTR lpstrFile
Definition: commdlg.h:336
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define LB_GETCURSEL
Definition: winuser.h:2021
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WM_DRAWITEM
Definition: winuser.h:1627
LPCSTR lpstrTitle
Definition: commdlg.h:341
#define SendMessage
Definition: winuser.h:5818
HMODULE hLibrary
Definition: dialog.c:549
#define SHACF_DEFAULT
Definition: shlwapi.h:1911
#define HIWORD(l)
Definition: typedefs.h:247
CAtlStringW CStringW
Definition: atlstr.h:130
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define CY_ITEM
Definition: dialogs.cpp:186
#define ODA_SELECT
Definition: winuser.h:2518

Referenced by PickIconDlg().

◆ RestartDialog()

int WINAPI RestartDialog ( HWND  hWndOwner,
LPCWSTR  lpstrReason,
DWORD  uFlags 
)

Definition at line 1557 of file dialogs.cpp.

1558 {
1559  return RestartDialogEx(hWndOwner, lpstrReason, uFlags, 0);
1560 }
int WINAPI RestartDialogEx(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason)
Definition: dialogs.cpp:1058
UINT uFlags
Definition: api.c:59

◆ RestartDialogEx()

int WINAPI RestartDialogEx ( HWND  hWndOwner,
LPCWSTR  lpwstrReason,
DWORD  uFlags,
DWORD  uReason 
)

Definition at line 1058 of file dialogs.cpp.

1059 {
1060  TRACE("(%p)\n", hWndOwner);
1061 
1062  CComPtr<IUnknown> fadeHandler;
1063  HWND parent;
1064 
1065  if (!CallShellDimScreen(&fadeHandler, &parent))
1066  parent = hWndOwner;
1067 
1068  /* FIXME: use lpwstrReason */
1070  {
1071  EnablePrivilege(L"SeShutdownPrivilege", TRUE);
1072  ExitWindowsEx(EWX_REBOOT, uReason);
1073  EnablePrivilege(L"SeShutdownPrivilege", FALSE);
1074  }
1075 
1076  return 0;
1077 }
#define TRUE
Definition: types.h:120
#define EWX_REBOOT
Definition: winuser.h:633
#define IDS_RESTART_TITLE
Definition: shresdef.h:82
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL ConfirmDialog(HWND hWndOwner, UINT PromptId, UINT TitleId)
Definition: dialogs.cpp:995
r parent
Definition: btrfs.c:2944
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, BOOL bEnablePrivilege)
Definition: dialogs.cpp:1028
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_RESTART_PROMPT
Definition: shresdef.h:83
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
BOOL CallShellDimScreen(IUnknown **pUnknown, HWND *hWindow)
Definition: dialogs.cpp:1008

Referenced by RestartDialog().

◆ RunDlg_GetParentDir()

static LPWSTR RunDlg_GetParentDir ( LPCWSTR  cmdline)
static

Definition at line 434 of file dialogs.cpp.

435 {
436  const WCHAR *src;
437  WCHAR *dest, *result, *result_end=NULL;
438  static const WCHAR dotexeW[] = L".exe";
439 
440  result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5));
441 
442  if (NULL == result)
443  {
444  TRACE("HeapAlloc couldn't allocate %d bytes\n", sizeof(WCHAR)*(strlenW(cmdline)+5));
445  return NULL;
446  }
447 
448  src = cmdline;
449  dest = result;
450 
451  if (*src == '"')
452  {
453  src++;
454  while (*src && *src != '"')
455  {
456  if (*src == '\\')
457  result_end = dest;
458  *dest++ = *src++;
459  }
460  }
461  else {
462  while (*src)
463  {
464  if (isspaceW(*src))
465  {
466  *dest = 0;
468  break;
469  strcatW(dest, dotexeW);
471  break;
472  }
473  else if (*src == '\\')
474  result_end = dest;
475  *dest++ = *src++;
476  }
477  }
478 
479  if (result_end)
480  {
481  *result_end = 0;
482  return result;
483  }
484  else
485  {
487  return NULL;
488  }
489 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLuint64EXT * result
Definition: glext.h:11304
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
Definition: unicode.h:165
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR L[]
Definition: oid.c:1250
GLenum src
Definition: glext.h:6340
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define NULL
Definition: types.h:112
static char * dest
Definition: rtl.c:135
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by RunDlgProc().

◆ RunDlgProc()

static INT_PTR CALLBACK RunDlgProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 514 of file dialogs.cpp.

515 {
517  HWND hwndCombo, hwndEdit;
518  COMBOBOXINFO ComboInfo;
519 
520  switch (message)
521  {
522  case WM_INITDIALOG:
523  prfdp = (RUNFILEDLGPARAMS *)lParam;
525 
526  if (prfdp->lpstrTitle)
527  SetWindowTextW(hwnd, prfdp->lpstrTitle);
528  if (prfdp->lpstrDescription)
530  if (prfdp->uFlags & RFF_NOBROWSE)
531  {
533  ShowWindow(browse, SW_HIDE);
534  EnableWindow(browse, FALSE);
535  }
536  if (prfdp->uFlags & RFF_NOLABEL)
538  if (prfdp->uFlags & RFF_NOSEPARATEMEM)
539  {
540  FIXME("RFF_NOSEPARATEMEM not supported\n");
541  }
542 
543  /* Use the default Shell Run icon if no one is specified */
544  if (prfdp->hIcon == NULL)
546  /*
547  * NOTE: Starting Windows Vista, the "Run File" dialog gets a
548  * title icon that remains the same as the default one, even if
549  * the user specifies a custom icon.
550  * Since we currently imitate Windows 2003, therefore do not show
551  * any title icon.
552  */
553  // SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM)prfdp->hIcon);
554  // SendMessageW(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)prfdp->hIcon);
556 
557  hwndCombo = GetDlgItem(hwnd, IDC_RUNDLG_EDITPATH);
558  FillList(hwndCombo, NULL, 0, (prfdp->uFlags & RFF_NODEFAULT) == 0);
560 
561  ComboInfo.cbSize = sizeof(ComboInfo);
562  GetComboBoxInfo(hwndCombo, &ComboInfo);
563  hwndEdit = ComboInfo.hwndItem;
565 
566  // SHAutoComplete needs co init
568 
570 
571  SetFocus(hwndCombo);
572  return TRUE;
573 
574  case WM_DESTROY:
575  if (prfdp->bCoInited)
576  CoUninitialize();
577  break;
578 
579  case WM_COMMAND:
580  switch (LOWORD(wParam))
581  {
582  case IDOK:
583  {
584  LRESULT lRet;
586  INT ic;
587  WCHAR *psz, *pszExpanded, *parent = NULL;
588  DWORD cchExpand;
589  NMRUNFILEDLGW nmrfd;
590 
591  ic = GetWindowTextLengthW(htxt);
592  if (ic == 0)
593  {
595  return TRUE;
596  }
597 
598  /*
599  * Allocate a new MRU entry, we need to add two characters
600  * for the terminating "\\1" part, then the NULL character.
601  */
602  psz = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (ic + 2 + 1)*sizeof(WCHAR));
603  if (!psz)
604  {
606  return TRUE;
607  }
608 
609  GetWindowTextW(htxt, psz, ic + 1);
610  StrTrimW(psz, L" \t");
611 
612  if (wcschr(psz, L'%') != NULL)
613  {
614  cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0);
615  pszExpanded = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchExpand * sizeof(WCHAR));
616  if (!pszExpanded)
617  {
618  HeapFree(GetProcessHeap(), 0, psz);
620  return TRUE;
621  }
622  ExpandEnvironmentStringsW(psz, pszExpanded, cchExpand);
623  StrTrimW(pszExpanded, L" \t");
624  }
625  else
626  {
627  pszExpanded = psz;
628  }
629 
630  /*
631  * The precedence is the following: first the user-given
632  * current directory is used; if there is none, a current
633  * directory is computed if the RFF_CALCDIRECTORY is set,
634  * otherwise no current directory is defined.
635  */
636  LPCWSTR pszStartDir;
637  if (prfdp->lpstrDirectory)
638  pszStartDir = prfdp->lpstrDirectory;
639  else if (prfdp->uFlags & RFF_CALCDIRECTORY)
640  pszStartDir = parent = RunDlg_GetParentDir(pszExpanded);
641  else
642  pszStartDir = NULL;
643 
644  /* Hide the dialog for now on, we will show it up in case of retry */
646 
647  /*
648  * As shown by manual tests on Windows, modifying the contents
649  * of the notification structure will not modify what the
650  * Run-Dialog will use for the nShow parameter. However the
651  * lpFile and lpDirectory pointers are set to the buffers used
652  * by the Run-Dialog, as a consequence they can be modified by
653  * the notification receiver, as long as it respects the lengths
654  * of the buffers (to avoid buffer overflows).
655  */
656  nmrfd.hdr.code = RFN_VALIDATE;
657  nmrfd.hdr.hwndFrom = hwnd;
658  nmrfd.hdr.idFrom = 0;
659  nmrfd.lpFile = pszExpanded;
660  nmrfd.lpDirectory = pszStartDir;
661  nmrfd.nShow = SW_SHOWNORMAL;
662 
663  lRet = SendMessageW(prfdp->hwndOwner, WM_NOTIFY, 0, (LPARAM)&nmrfd.hdr);
664 
665  switch (lRet)
666  {
667  case RF_CANCEL:
669  break;
670 
671  case RF_OK:
672  if (SUCCEEDED(ShellExecCmdLine(hwnd, pszExpanded, pszStartDir, SW_SHOWNORMAL, NULL,
674  {
675  /* Call again GetWindowText in case the contents of the edit box has changed? */
676  GetWindowTextW(htxt, psz, ic + 1);
677  FillList(htxt, psz, ic + 2 + 1, FALSE);
678  EndDialog(hwnd, IDOK);
679  break;
680  }
681 
682  /* Fall-back */
683  case RF_RETRY:
684  default:
685  SendMessageW(htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1));
686  /* Show back the dialog */
688  break;
689  }
690 
692  HeapFree(GetProcessHeap(), 0, psz);
693  if (psz != pszExpanded)
694  HeapFree(GetProcessHeap(), 0, pszExpanded);
695  return TRUE;
696  }
697 
698  case IDCANCEL:
700  return TRUE;
701 
702  case IDC_RUNDLG_BROWSE:
703  {
704  HMODULE hComdlg = NULL;
705  LPFNOFN ofnProc = NULL;
706  WCHAR szFName[1024] = {0};
707  WCHAR filter[MAX_PATH], szCaption[MAX_PATH];
709 
712 
713  ZeroMemory(&ofn, sizeof(ofn));
714  ofn.lStructSize = sizeof(ofn);
715  ofn.hwndOwner = hwnd;
717  ofn.lpstrFile = szFName;
718  ofn.nMaxFile = _countof(szFName) - 1;
719  ofn.lpstrTitle = szCaption;
722 
723  if (NULL == (hComdlg = LoadLibraryExW(L"comdlg32", NULL, 0)) ||
724  NULL == (ofnProc = (LPFNOFN)GetProcAddress(hComdlg, "GetOpenFileNameW")))
725  {
726  ERR("Couldn't get GetOpenFileName function entry (lib=%p, proc=%p)\n", hComdlg, ofnProc);
728  return TRUE;
729  }
730 
731  if (ofnProc(&ofn))
732  {
738  }
739 
740  FreeLibrary(hComdlg);
741 
742  return TRUE;
743  }
744  case IDC_RUNDLG_EDITPATH:
745  {
746  if (HIWORD(wParam) == CBN_EDITCHANGE)
747  {
749  }
750  return TRUE;
751  }
752  }
753  return TRUE;
754  }
755  return FALSE;
756 }
#define SHACF_URLALL
Definition: shlwapi.h:1915
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_EXPLORER
Definition: commdlg.h:104
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define STM_SETICON
Definition: winuser.h:2074
#define IDC_RUNDLG_EDITPATH
Definition: shresdef.h:335
Definition: tftpd.h:59
static void FillList(HWND, LPWSTR, UINT, BOOL)
Definition: dialogs.cpp:764
#define IDOK
Definition: winuser.h:824
#define IDC_RUNDLG_ICON
Definition: shresdef.h:334
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hwndOwner
Definition: commdlg.h:330
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
OPENFILENAME ofn
Definition: main.cpp:37
#define ZeroMemory
Definition: winbase.h:1664
LPCWSTR lpDirectory
Definition: undocshell.h:151
HWND WINAPI SetFocus(_In_opt_ HWND)
#define RF_OK
Definition: undocshell.h:160
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define GetWindowLongPtrW
Definition: winuser.h:4804
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IDS_RUNDLG_BROWSE_ERROR
Definition: shresdef.h:193
#define RF_CANCEL
Definition: undocshell.h:161
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static void EnableOkButtonFromEditContents(HWND hwnd)
Definition: dialogs.cpp:491
static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
Definition: dialogs.cpp:434
DWORD nMaxFile
Definition: commdlg.h:337
UINT code
Definition: winuser.h:3134
LPCWSTR lpstrDescription
Definition: dialogs.cpp:31
#define IDC_RUNDLG_DESCRIPTION
Definition: shresdef.h:332
#define FALSE
Definition: types.h:117
UINT_PTR idFrom
Definition: winuser.h:3133
if SUCCEEDED(hr)
#define IDS_RUNDLG_BROWSE_FILTER
Definition: shresdef.h:195
#define FIXME(fmt,...)
Definition: debug.h:111
#define IDC_RUNDLG_LABEL
Definition: shresdef.h:336
#define SHACF_FILESYSTEM
Definition: shlwapi.h:1912
#define RFN_VALIDATE
Definition: undocshell.h:137
LONG_PTR LPARAM
Definition: windef.h:208
#define SECL_ALLOW_NONEXE
#define SW_SHOW
Definition: winuser.h:769
#define WM_DESTROY
Definition: winuser.h:1591
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
Definition: autocomp.cpp:191
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
#define RFF_NOSEPARATEMEM
Definition: run.h:50
#define FreeLibrary(x)
Definition: compat.h:607
#define ShellExecCmdLine
#define GetProcessHeap()
Definition: compat.h:595
#define CBN_EDITCHANGE
Definition: winuser.h:1957
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define ASSERT(a)
Definition: mode.c:44
r parent
Definition: btrfs.c:2944
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
#define _countof(array)
Definition: sndvol32.h:68
LPCWSTR lpFile
Definition: undocshell.h:150
#define MAX_PATH
Definition: compat.h:34
DWORD lStructSize
Definition: commdlg.h:329
int WINAPI GetWindowTextLengthW(_In_ HWND)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RFF_NODEFAULT
Definition: run.h:47
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
#define RFF_NOLABEL
Definition: run.h:49
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define ERR(fmt,...)
Definition: debug.h:110
#define RFF_CALCDIRECTORY
Definition: run.h:48
HWND hwndEdit
Definition: combotst.c:65
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define shell32_hInstance
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
LPSTR lpstrFile
Definition: commdlg.h:336
#define CB_SETEDITSEL
Definition: winuser.h:1945
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define ShellMessageBoxW
Definition: precomp.h:58
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
BOOL(WINAPI * LPFNOFN)(OPENFILENAMEW *)
Definition: dialogs.cpp:46
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
LPCWSTR lpstrTitle
Definition: dialogs.cpp:30
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1869
LPCSTR lpstrTitle
Definition: commdlg.h:341
#define IDC_RUNDLG_BROWSE
Definition: resource.h:7
#define IDS_RUNDLG_BROWSE_CAPTION
Definition: shresdef.h:194
#define HIWORD(l)
Definition: typedefs.h:247
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define RFF_NOBROWSE
Definition: run.h:46
LPCWSTR lpstrDirectory
Definition: dialogs.cpp:29
#define GetProcAddress(x, y)
Definition: compat.h:612
#define SHACF_FILESYS_ONLY
Definition: shlwapi.h:1917
#define SetWindowLongPtrW
Definition: winuser.h:5321
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define OFN_ENABLESIZING
Definition: commdlg.h:101
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define WM_NOTIFY
Definition: richedit.h:61
#define IDI_SHELL_RUN
Definition: shresdef.h:546
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
DWORD Flags
Definition: commdlg.h:342
#define RF_RETRY
Definition: undocshell.h:162

Referenced by RunFileDlg().

◆ RunFileDlg()

void WINAPI RunFileDlg ( HWND  hWndOwner,
HICON  hIcon,
LPCWSTR  lpstrDirectory,
LPCWSTR  lpstrTitle,
LPCWSTR  lpstrDescription,
UINT  uFlags 
)

Definition at line 411 of file dialogs.cpp.

418 {
419  TRACE("\n");
420 
421  RUNFILEDLGPARAMS rfdp;
422  rfdp.hwndOwner = hWndOwner;
423  rfdp.hIcon = hIcon;
424  rfdp.lpstrDirectory = lpstrDirectory;
425  rfdp.lpstrTitle = lpstrTitle;
426  rfdp.lpstrDescription = lpstrDescription;
427  rfdp.uFlags = uFlags;
428 
430 }
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
UINT uFlags
Definition: api.c:59
LPCWSTR lpstrDescription
Definition: dialogs.cpp:31
LONG_PTR LPARAM
Definition: windef.h:208
static INT_PTR CALLBACK RunDlgProc(HWND, UINT, WPARAM, LPARAM)
Definition: dialogs.cpp:514
#define TRACE(s)
Definition: solgame.cpp:4
#define IDD_RUN
Definition: shresdef.h:331
#define shell32_hInstance
HICON hIcon
Definition: msconfig.c:44
LPCWSTR lpstrTitle
Definition: dialogs.cpp:30
LPCWSTR lpstrDirectory
Definition: dialogs.cpp:29
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by RunDialogThread::Run(), CTrayWindow::RunFileDlgThread(), and TaskManager_OnFileNew().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ s_pszDefaultPath

const LPCWSTR s_pszDefaultPath = L"%SystemRoot%\\system32\\shell32.dll"
static

Definition at line 167 of file dialogs.cpp.

Referenced by NoIconsInFile(), and PickIconDlg().