Added PickiconDlg dialog resources as a test
-- v9: shell32: Implement PickIconDlg function
From: Matthias Zorn matthias0178@gmail.com
--- dlls/shell32/dialogs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 665c7093953..f99c031d7ef 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -79,7 +79,8 @@ static void FillList (HWND, char *, BOOL) ; */ INT WINAPI PickIconDlg(HWND hwndOwner, WCHAR *path, UINT path_len, INT *index) { - FIXME("(%p,%s,%u,%p):stub.\n", hwndOwner, debugstr_w(path), path_len, index); + /*FIXME("(%p,%s,%u,%p):stub.\n", hwndOwner, debugstr_w(path), path_len, index);*/ + MessageBoxW(hwndOwner, L"Hi world!", NULL, MB_OK); return 0xffffffff; }
From: Matthias Zorn matthias0178@gmail.com
--- dlls/shell32/dialogs.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index f99c031d7ef..30998f8e4bb 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -72,6 +72,37 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); static INT_PTR CALLBACK RunDlgProc (HWND, UINT, WPARAM, LPARAM) ; static void FillList (HWND, char *, BOOL) ;
+static WCHAR *PickIconDlg_CreateExpanded(WCHAR *just_path_with_backslash_at_end, WCHAR *file_name) +{ + WCHAR *return_value, *unexpanded; + int length_path, length_file_name; + DWORD required_expanded_size, number; + length_path = lstrlenW(just_path_with_backslash_at_end); + length_file_name = lstrlenW(file_name); + unexpanded = malloc((length_path + length_file_name + 1) * sizeof(WCHAR)); + if(unexpanded == NULL) + return NULL; + lstrcpyW(unexpanded, just_path_with_backslash_at_end); + lstrcatW(unexpanded, file_name); + required_expanded_size = ExpandEnvironmentStringsW(unexpanded, NULL, 0); + return_value = malloc(required_expanded_size * sizeof(WCHAR)); + if(return_value == NULL) + { + free(unexpanded); + return NULL; + } + number = ExpandEnvironmentStringsW(unexpanded, return_value, + required_expanded_size * sizeof(WCHAR)); + if(number == 0) + { + if(return_value != NULL) + free(return_value); + return_value = NULL; + } + free(unexpanded); + return return_value; +} +
/************************************************************************* * PickIconDlg [SHELL32.62] @@ -79,8 +110,11 @@ static void FillList (HWND, char *, BOOL) ; */ INT WINAPI PickIconDlg(HWND hwndOwner, WCHAR *path, UINT path_len, INT *index) { + WCHAR *expanded; + const WCHAR filename[] = { 'a', '.', 'o', 'u', 't', 0 }; + expanded = PickIconDlg_CreateExpanded(path, filename); /*FIXME("(%p,%s,%u,%p):stub.\n", hwndOwner, debugstr_w(path), path_len, index);*/ - MessageBoxW(hwndOwner, L"Hi world!", NULL, MB_OK); + MessageBoxW(hwndOwner, L"Hi world!", expanded, MB_OK); return 0xffffffff; }
From: Matthias Zorn matthias0178@gmail.com
--- dlls/shell32/dialogs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 30998f8e4bb..44865508f0a 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -111,7 +111,7 @@ static WCHAR *PickIconDlg_CreateExpanded(WCHAR *just_path_with_backslash_at_end, INT WINAPI PickIconDlg(HWND hwndOwner, WCHAR *path, UINT path_len, INT *index) { WCHAR *expanded; - const WCHAR filename[] = { 'a', '.', 'o', 'u', 't', 0 }; + WCHAR filename[] = { 'a', '.', 'o', 'u', 't', 0 }; expanded = PickIconDlg_CreateExpanded(path, filename); /*FIXME("(%p,%s,%u,%p):stub.\n", hwndOwner, debugstr_w(path), path_len, index);*/ MessageBoxW(hwndOwner, L"Hi world!", expanded, MB_OK);