shell32: Implement the DeleteGroup() command for Progman DDE.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2017-11-29 17:00:47 -06:00 committed by Alexandre Julliard
parent 83ca4e20cc
commit 957da4ee07
2 changed files with 26 additions and 6 deletions

View File

@ -120,6 +120,7 @@ static WCHAR *get_programs_path(WCHAR *name)
static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
{
static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0};
static const WCHAR delete_groupW[] = {'D','e','l','e','t','e','G','r','o','u','p',0};
if (!strcmpiW(command, create_groupW))
{
@ -134,6 +135,31 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
HeapFree(GetProcessHeap(), 0, path);
}
else if (!strcmpiW(command, delete_groupW))
{
WCHAR *path, *path2;
SHFILEOPSTRUCTW shfos = {0};
int ret;
if (argc < 1) return DDE_FNOTPROCESSED;
path = get_programs_path(argv[0]);
path2 = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 2) * sizeof(*path));
strcpyW(path2, path);
path2[strlenW(path) + 1] = 0;
shfos.wFunc = FO_DELETE;
shfos.pFrom = path2;
shfos.fFlags = FOF_NOCONFIRMATION;
ret = SHFileOperationW(&shfos);
HeapFree(GetProcessHeap(), 0, path2);
HeapFree(GetProcessHeap(), 0, path);
if (ret || shfos.fAnyOperationsAborted) return DDE_FNOTPROCESSED;
}
else
{
FIXME("unhandled command %s\n", debugstr_w(command));

View File

@ -347,10 +347,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
/* DeleteGroup Test */
error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]");
todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group1"), "directory should not exist\n");
}
/* Compound Execute String Command */
sprintf(comptext, "[CreateGroup(Group3)][AddItem(%s,f1g3Name)][AddItem(%s,f2g3Name)]", f1g3, f2g3);
@ -365,10 +363,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
}
error = dde_execute(instance, hConv, "[DeleteGroup(Group3)]");
todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group3"), "directory should not exist\n");
}
/* Full Parameters of Add Item */
/* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */
@ -392,10 +388,8 @@ static void test_progman_dde2(DWORD instance, HCONV hConv)
ok(check_window_exists(Group2Title), "window not created\n");
error = dde_execute(instance, hConv, "[DeleteGroup(Group2)]");
todo_wine {
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
ok(!check_exists("Group2"), "directory should not exist\n");
}
}
START_TEST(progman_dde)