Module: wine Branch: refs/heads/master Commit: cb0c81ae8c7b5ee804ff3cdcf1b2c67b42b63b6f URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=cb0c81ae8c7b5ee804ff3cdc...
Author: Mikołaj Zalewski mikolaj@zalewski.pl Date: Fri Jun 30 22:47:12 2006 +0200
shell32: Allow for custom icons in confirmation messages.
---
dlls/shell32/shlfileop.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 242e252..90cf9e2 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -67,11 +67,15 @@ static DWORD SHFindAttrW(LPCWSTR pName,
typedef struct { + HINSTANCE hIconInstance; + UINT icon_resource_id; UINT caption_resource_id, text_resource_id; } SHELL_ConfirmIDstruc;
static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids) { + ids->hIconInstance = NULL; + ids->icon_resource_id = IDI_WARNING; switch (nKindOfDialog) { case ASK_DELETE_FILE: ids->caption_resource_id = IDS_DELETEITEM_CAPTION; @@ -99,6 +103,7 @@ BOOL SHELL_ConfirmDialogW(HWND hWnd, int { WCHAR szCaption[255], szText[255], szBuffer[MAX_PATH + 256]; SHELL_ConfirmIDstruc ids; + MSGBOXPARAMSW params;
if (!SHELL_ConfirmIDs(nKindOfDialog, &ids)) return FALSE; @@ -109,7 +114,16 @@ BOOL SHELL_ConfirmDialogW(HWND hWnd, int FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY, szText, 0, 0, szBuffer, sizeof(szBuffer), (va_list*)&szDir);
- return (IDOK == MessageBoxW(hWnd, szBuffer, szCaption, MB_OKCANCEL | MB_ICONEXCLAMATION)); + ZeroMemory(¶ms, sizeof(params)); + params.cbSize = sizeof(MSGBOXPARAMSW); + params.hwndOwner = hWnd; + params.hInstance = ids.hIconInstance; + params.lpszText = szBuffer; + params.lpszCaption = szCaption; + params.lpszIcon = (LPWSTR)MAKEINTRESOURCE(ids.icon_resource_id); + params.dwStyle = MB_OKCANCEL | MB_USERICON; + + return (IDOK == MessageBoxIndirectW(¶ms)); }
static DWORD SHELL32_AnsiToUnicodeBuf(LPCSTR aPath, LPWSTR *wPath, DWORD minChars)