shell32: Implement the CreateGroup() 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:
parent
6778023999
commit
83ca4e20cc
|
@ -97,10 +97,49 @@ static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Returned string must be freed by caller */
|
||||
static WCHAR *get_programs_path(WCHAR *name)
|
||||
{
|
||||
static const WCHAR slashW[] = {'/',0};
|
||||
WCHAR *programs, *path;
|
||||
int len;
|
||||
|
||||
SHGetKnownFolderPath(&FOLDERID_Programs, 0, NULL, &programs);
|
||||
|
||||
len = lstrlenW(programs) + 1 + lstrlenW(name);
|
||||
path = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(*path));
|
||||
lstrcpyW(path, programs);
|
||||
lstrcatW(path, slashW);
|
||||
lstrcatW(path, name);
|
||||
|
||||
CoTaskMemFree(programs);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv)
|
||||
{
|
||||
FIXME("unhandled command %s\n", debugstr_w(command));
|
||||
return DDE_FNOTPROCESSED;
|
||||
static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0};
|
||||
|
||||
if (!strcmpiW(command, create_groupW))
|
||||
{
|
||||
WCHAR *path;
|
||||
|
||||
if (argc < 1) return DDE_FNOTPROCESSED;
|
||||
|
||||
path = get_programs_path(argv[0]);
|
||||
|
||||
CreateDirectoryW(path, NULL);
|
||||
ShellExecuteW(NULL, NULL, path, NULL, NULL, SW_SHOWNORMAL);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("unhandled command %s\n", debugstr_w(command));
|
||||
return DDE_FNOTPROCESSED;
|
||||
}
|
||||
return DDE_FACK;
|
||||
}
|
||||
|
||||
static DWORD parse_dde_command(HSZ hszTopic, WCHAR *command)
|
||||
|
|
|
@ -281,12 +281,9 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
|
|||
|
||||
/* CreateGroup Tests (including AddItem, DeleteItem) */
|
||||
error = dde_execute(instance, hConv, "[CreateGroup(Group1)]");
|
||||
todo_wine {
|
||||
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
|
||||
ok(check_exists("Group1"), "directory not created\n");
|
||||
if (error == DMLERR_NO_ERROR)
|
||||
ok(check_window_exists(Group1Title), "window not created\n");
|
||||
}
|
||||
ok(check_window_exists(Group1Title), "window not created\n");
|
||||
|
||||
sprintf(itemtext, "[AddItem(%s,f1g1Name)]", f1g1);
|
||||
error = dde_execute(instance, hConv, itemtext);
|
||||
|
@ -315,21 +312,15 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
|
|||
}
|
||||
|
||||
error = dde_execute(instance, hConv, "[CreateGroup(Group2)]");
|
||||
todo_wine {
|
||||
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
|
||||
ok(check_exists("Group2"), "directory not created\n");
|
||||
if (error == DMLERR_NO_ERROR)
|
||||
ok(check_window_exists(Group2Title), "window not created\n");
|
||||
}
|
||||
ok(check_window_exists(Group2Title), "window not created\n");
|
||||
|
||||
/* Create Group that already exists - same instance */
|
||||
error = dde_execute(instance, hConv, "[CreateGroup(Group1)]");
|
||||
todo_wine {
|
||||
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
|
||||
ok(check_exists("Group1"), "directory not created\n");
|
||||
if (error == DMLERR_NO_ERROR)
|
||||
ok(check_window_exists(Group1Title), "window not created\n");
|
||||
}
|
||||
ok(check_window_exists(Group1Title), "window not created\n");
|
||||
|
||||
/* ShowGroup Tests */
|
||||
error = dde_execute(instance, hConv, "[ShowGroup(Group1)]");
|
||||
|
@ -356,26 +347,28 @@ static void test_progman_dde(DWORD instance, HCONV hConv)
|
|||
|
||||
/* DeleteGroup Test */
|
||||
error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]");
|
||||
todo_wine
|
||||
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);
|
||||
error = dde_execute(instance, hConv, comptext);
|
||||
todo_wine {
|
||||
todo_wine
|
||||
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
|
||||
ok(check_exists("Group3"), "directory not created\n");
|
||||
if (error == DMLERR_NO_ERROR)
|
||||
ok(check_window_exists(Group3Title), "window not created\n");
|
||||
ok(check_window_exists(Group3Title), "window not created\n");
|
||||
todo_wine {
|
||||
ok(check_exists("Group3/f1g3Name.lnk"), "link not created\n");
|
||||
ok(check_exists("Group3/f2g3Name.lnk"), "link not created\n");
|
||||
}
|
||||
|
||||
error = dde_execute(instance, hConv, "[DeleteGroup(Group3)]");
|
||||
todo_wine
|
||||
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]]]]]]]) */
|
||||
|
@ -394,17 +387,15 @@ static void test_progman_dde2(DWORD instance, HCONV hConv)
|
|||
|
||||
/* Create Group that already exists on a separate connection */
|
||||
error = dde_execute(instance, hConv, "[CreateGroup(Group2)]");
|
||||
todo_wine {
|
||||
ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error);
|
||||
ok(check_exists("Group2"), "directory not created\n");
|
||||
if (error == DMLERR_NO_ERROR)
|
||||
ok(check_window_exists(Group2Title), "window not created\n");
|
||||
}
|
||||
ok(check_window_exists(Group2Title), "window not created\n");
|
||||
|
||||
error = dde_execute(instance, hConv, "[DeleteGroup(Group2)]");
|
||||
todo_wine
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue