shell32 - ShellDDEInit
Steven Edwards
steven_ed4153 at yahoo.com
Wed Apr 27 21:34:05 CDT 2005
The ReactOS guys are tired of seeing the fixme message.
Changelog:
Implement ShellDDEInit
Index: lib/shell32/shell32_main.c
===================================================================
--- lib/shell32/shell32_main.c (revision 14808)
+++ lib/shell32/shell32_main.c (working copy)
@@ -979,13 +979,66 @@
FIXME("%lx: stub\n",dw);
}
-
+ATOM ProgmanAtom;
+DWORD hDde;
+UINT hProgmanTopic, hProgmanService, hStar, hShell, hAppProps, hFolders;
+
/*************************************************************************
* ShellDDEInit (SHELL32.@)
*/
-void WINAPI ShellDDEInit(BOOL start)
+void WINAPI ShellDDEInit(BOOL Start)
{
- FIXME("stub: %d\n", start);
+ WCHAR wszSHELL_PROGMAN[] = {'P','R','O','G','M','A','N',0};
+ WCHAR wszSHELL_TOPIC[] = {'P','r','o','g','m','a','n',0};
+ WCHAR wszSHELL_SERVICE[] = {'P','r','o','g','m','a','n',0};
+ WCHAR wszSHELL_STAR[] = {'*',0};
+ WCHAR wszSHELL_SHELL[] = {'S','h','e','l','l',0};
+ WCHAR wszSHELL_APPPROPS[] = {'A','p','p','P','r','o','p', 'e', 'r', 't', 'i', 'e', 's',0};
+ WCHAR wszSHELL_FOLDERS[] = {'F','o','l','d','e','r','s',0};
+
+ if (Start)
+ {
+ /* Create Atom */
+ ProgmanAtom = GlobalAddAtomW(wszSHELL_PROGMAN);
+
+ /* Initialize DDE */
+ DdeInitializeW(&hDde, NULL, CBF_FAIL_POKES | CBF_FAIL_ADVISES, 0L);
+
+ /* Register the Strings */
+ hProgmanTopic = DdeCreateStringHandleW(hDde, wszSHELL_TOPIC, CP_WINUNICODE);
+ hProgmanService = DdeCreateStringHandleW(hDde, wszSHELL_SERVICE, CP_WINUNICODE);
+ hStar = DdeCreateStringHandleW(hDde, wszSHELL_STAR, CP_WINUNICODE);
+ hShell = DdeCreateStringHandleW(hDde, wszSHELL_SHELL, CP_WINUNICODE);
+ hAppProps = DdeCreateStringHandleW(hDde, wszSHELL_APPPROPS, CP_WINUNICODE);
+ hFolders = DdeCreateStringHandleW(hDde, wszSHELL_FOLDERS, CP_WINUNICODE);
+
+ /* Register the Service Names */
+ DdeNameService(hDde, hFolders, 0, DNS_REGISTER);
+ DdeNameService(hDde, hProgmanService, 0, DNS_REGISTER);
+ DdeNameService(hDde, hShell, 0, DNS_REGISTER);
+ }
+ else
+ {
+ /* Unregister the Service Names */
+ DdeNameService(hDde, hFolders, 0, DNS_UNREGISTER);
+ DdeNameService(hDde, hProgmanService, 0, DNS_UNREGISTER);
+ DdeNameService(hDde, hShell, 0, DNS_UNREGISTER);
+
+ /* Free the Handles */
+ DdeFreeStringHandle(hDde, hProgmanTopic);
+ DdeFreeStringHandle(hDde, hProgmanService);
+ DdeFreeStringHandle(hDde, hStar);
+ DdeFreeStringHandle(hDde, hShell);
+ DdeFreeStringHandle(hDde, hAppProps);
+ DdeFreeStringHandle(hDde, hFolders);
+
+ /* Uninitialize DDE */
+ DdeUninitialize(hDde);
+ hDde = 0;
+
+ /* Delete the Atom */
+ if (ProgmanAtom) ProgmanAtom = GlobalDeleteAtom(ProgmanAtom);
+ }
}
/***********************************************************************
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the wine-patches
mailing list