~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/shell32/dde.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Shell DDE Handling
  3  *
  4  * Copyright 2004 Robert Shearman
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #include <stdarg.h>
 22 
 23 #include "windef.h"
 24 #include "winbase.h"
 25 #include "ddeml.h"
 26 #include "shellapi.h"
 27 
 28 #include "wine/debug.h"
 29 
 30 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 31 
 32 /* String handles */
 33 static HSZ hszProgmanTopic;
 34 static HSZ hszProgmanService;
 35 static HSZ hszAsterisk;
 36 static HSZ hszShell;
 37 static HSZ hszAppProperties;
 38 static HSZ hszFolders;
 39 /* DDE Instance ID */
 40 static DWORD dwDDEInst;
 41 
 42 
 43 static inline BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService)
 44 {
 45     if ((hszTopic == hszProgmanTopic) && (hszService == hszProgmanService))
 46         return TRUE;
 47     if ((hszTopic == hszProgmanTopic) && (hszService == hszAppProperties))
 48         return TRUE;
 49     if ((hszTopic == hszShell) && (hszService == hszFolders))
 50         return TRUE;
 51     if ((hszTopic == hszShell) && (hszService == hszAppProperties))
 52         return TRUE;
 53     return FALSE;
 54 }
 55 
 56 static inline void Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService)
 57 {
 58     FIXME("stub\n");
 59 }
 60 
 61 static inline BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService)
 62 {
 63     FIXME("stub\n");
 64     return FALSE;
 65 }
 66 
 67 static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic,
 68                                      HSZ hszItem)
 69 {
 70     FIXME("stub\n");
 71     return NULL;
 72 }
 73 
 74 static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata)
 75 {
 76     BYTE * pszCommand;
 77 
 78     pszCommand = DdeAccessData(hdata, NULL);
 79     if (!pszCommand)
 80         return DDE_FNOTPROCESSED;
 81 
 82     FIXME("stub: %s\n", pszCommand);
 83 
 84     DdeUnaccessData(hdata);
 85 
 86     return DDE_FNOTPROCESSED;
 87 }
 88 
 89 static inline void Dde_OnDisconnect(HCONV hconv)
 90 {
 91     FIXME("stub\n");
 92 }
 93 
 94 static HDDEDATA CALLBACK DdeCallback(      
 95     UINT uType,
 96     UINT uFmt,
 97     HCONV hconv,
 98     HSZ hsz1,
 99     HSZ hsz2,
100     HDDEDATA hdata,
101     ULONG_PTR dwData1,
102     ULONG_PTR dwData2)
103 {
104     switch (uType)
105     {
106     case XTYP_CONNECT:
107         return (HDDEDATA)(DWORD_PTR)Dde_OnConnect(hsz1, hsz2);
108     case XTYP_CONNECT_CONFIRM:
109         Dde_OnConnectConfirm(hconv, hsz1, hsz2);
110         return NULL;
111     case XTYP_WILDCONNECT:
112         return (HDDEDATA)(DWORD_PTR)Dde_OnWildConnect(hsz1, hsz2);
113     case XTYP_REQUEST:
114         return Dde_OnRequest(uFmt, hconv, hsz1, hsz2);
115     case XTYP_EXECUTE:
116         return (HDDEDATA)(DWORD_PTR)Dde_OnExecute(hconv, hsz1, hdata);
117     case XTYP_DISCONNECT:
118         Dde_OnDisconnect(hconv);
119         return NULL;
120     default:
121         return NULL;
122     }
123 }
124 
125 /*************************************************************************
126  * ShellDDEInit (SHELL32.@)
127  *
128  * Registers the Shell DDE services with the system so that applications
129  * can use them.
130  *
131  * PARAMS
132  *  bInit [I] TRUE to initialize the services, FALSE to uninitalize.
133  *
134  * RETURNS
135  *  Nothing.
136  */
137 void WINAPI ShellDDEInit(BOOL bInit)
138 {
139     TRACE("bInit = %s\n", bInit ? "TRUE" : "FALSE");
140 
141     if (bInit)
142     {
143         static const WCHAR wszProgman[] = {'P','r','o','g','m','a','n',0};
144         static const WCHAR wszAsterisk[] = {'*',0};
145         static const WCHAR wszShell[] = {'S','h','e','l','l',0};
146         static const WCHAR wszAppProperties[] =
147             {'A','p','p','P','r','o','p','e','r','t','i','e','s',0};
148         static const WCHAR wszFolders[] = {'F','o','l','d','e','r','s',0};
149 
150         DdeInitializeW(&dwDDEInst, DdeCallback, CBF_FAIL_ADVISES | CBF_FAIL_POKES, 0);
151 
152         hszProgmanTopic = DdeCreateStringHandleW(dwDDEInst, wszProgman, CP_WINUNICODE);
153         hszProgmanService = DdeCreateStringHandleW(dwDDEInst, wszProgman, CP_WINUNICODE);
154         hszAsterisk = DdeCreateStringHandleW(dwDDEInst, wszAsterisk, CP_WINUNICODE);
155         hszShell = DdeCreateStringHandleW(dwDDEInst, wszShell, CP_WINUNICODE);
156         hszAppProperties = DdeCreateStringHandleW(dwDDEInst, wszAppProperties, CP_WINUNICODE);
157         hszFolders = DdeCreateStringHandleW(dwDDEInst, wszFolders, CP_WINUNICODE);
158 
159         DdeNameService(dwDDEInst, hszFolders, 0, DNS_REGISTER);
160         DdeNameService(dwDDEInst, hszProgmanService, 0, DNS_REGISTER);
161         DdeNameService(dwDDEInst, hszShell, 0, DNS_REGISTER);
162     }
163     else
164     {
165         /* unregister all services */
166         DdeNameService(dwDDEInst, 0, 0, DNS_UNREGISTER);
167 
168         DdeFreeStringHandle(dwDDEInst, hszFolders);
169         DdeFreeStringHandle(dwDDEInst, hszAppProperties);
170         DdeFreeStringHandle(dwDDEInst, hszShell);
171         DdeFreeStringHandle(dwDDEInst, hszAsterisk);
172         DdeFreeStringHandle(dwDDEInst, hszProgmanService);
173         DdeFreeStringHandle(dwDDEInst, hszProgmanTopic);
174 
175         DdeUninitialize(dwDDEInst);
176     }
177 }
178 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.