* Sync up to trunk head (r64829).
[reactos.git] / dll / win32 / oledlg / oledlg_main.c
1 /*
2 * OLEDLG library
3 *
4 * Copyright 1998 Patrik Stridvall
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 "oledlg_private.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(ole);
24
25 HINSTANCE OLEDLG_hInstance = 0;
26
27 UINT cf_embed_source;
28 UINT cf_embedded_object;
29 UINT cf_link_source;
30 UINT cf_object_descriptor;
31 UINT cf_link_src_descriptor;
32 UINT cf_ownerlink;
33 UINT cf_filename;
34 UINT cf_filenamew;
35
36 UINT oleui_msg_help;
37 UINT oleui_msg_enddialog;
38
39 static void register_clipboard_formats(void)
40 {
41 /* These used to be declared in olestd.h, but that seems to have been removed from the api */
42 static const WCHAR CF_EMBEDSOURCEW[] = { 'E','m','b','e','d',' ','S','o','u','r','c','e',0 };
43 static const WCHAR CF_EMBEDDEDOBJECTW[] = { 'E','m','b','e','d','d','e','d',' ','O','b','j','e','c','t',0 };
44 static const WCHAR CF_LINKSOURCEW[] = { 'L','i','n','k',' ','S','o','u','r','c','e',0 };
45 static const WCHAR CF_OBJECTDESCRIPTORW[] = { 'O','b','j','e','c','t',' ','D','e','s','c','r','i','p','t','o','r',0 };
46 static const WCHAR CF_LINKSRCDESCRIPTORW[] = { 'L','i','n','k',' ','S','o','u','r','c','e',' ','D','e','s','c','r','i','p','t','o','r',0 };
47 static const WCHAR CF_OWNERLINKW[] = { 'O','w','n','e','r','L','i','n','k',0 };
48 static const WCHAR CF_FILENAMEW[] = { 'F','i','l','e','N','a','m','e',0 };
49 static const WCHAR CF_FILENAMEWW[] = { 'F','i','l','e','N','a','m','e','W',0 };
50
51 /* Load in the same order as native to make debugging easier */
52 cf_object_descriptor = RegisterClipboardFormatW(CF_OBJECTDESCRIPTORW);
53 cf_link_src_descriptor = RegisterClipboardFormatW(CF_LINKSRCDESCRIPTORW);
54 cf_embed_source = RegisterClipboardFormatW(CF_EMBEDSOURCEW);
55 cf_embedded_object = RegisterClipboardFormatW(CF_EMBEDDEDOBJECTW);
56 cf_link_source = RegisterClipboardFormatW(CF_LINKSOURCEW);
57 cf_ownerlink = RegisterClipboardFormatW(CF_OWNERLINKW);
58 cf_filename = RegisterClipboardFormatW(CF_FILENAMEW);
59 cf_filenamew = RegisterClipboardFormatW(CF_FILENAMEWW);
60 }
61
62 static void register_messages(void)
63 {
64 oleui_msg_help = RegisterWindowMessageW(SZOLEUI_MSG_HELPW);
65 oleui_msg_enddialog = RegisterWindowMessageW(SZOLEUI_MSG_ENDDIALOGW);
66 }
67
68 /***********************************************************************
69 * DllMain
70 */
71 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
72 {
73 TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
74
75 switch(fdwReason) {
76 case DLL_PROCESS_ATTACH:
77 DisableThreadLibraryCalls(hinstDLL);
78 OLEDLG_hInstance = hinstDLL;
79 register_clipboard_formats();
80 register_messages();
81 break;
82 }
83 return TRUE;
84 }
85
86
87 /***********************************************************************
88 * OleUIAddVerbMenuA (OLEDLG.1)
89 */
90 BOOL WINAPI OleUIAddVerbMenuA(
91 LPOLEOBJECT lpOleObj, LPCSTR lpszShortType,
92 HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
93 BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
94 {
95 FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
96 lpOleObj, debugstr_a(lpszShortType),
97 hMenu, uPos, uIDVerbMin, uIDVerbMax,
98 bAddConvert, idConvert, lphMenu
99 );
100 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
101 return FALSE;
102 }
103
104 /***********************************************************************
105 * OleUIAddVerbMenuW (OLEDLG.14)
106 */
107 BOOL WINAPI OleUIAddVerbMenuW(
108 LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType,
109 HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
110 BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
111 {
112 FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
113 lpOleObj, debugstr_w(lpszShortType),
114 hMenu, uPos, uIDVerbMin, uIDVerbMax,
115 bAddConvert, idConvert, lphMenu
116 );
117 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
118 return FALSE;
119 }
120
121 /***********************************************************************
122 * OleUICanConvertOrActivateAs (OLEDLG.2)
123 */
124 BOOL WINAPI OleUICanConvertOrActivateAs(
125 REFCLSID rClsid, BOOL fIsLinkedObject, WORD wFormat)
126 {
127 FIXME("(%p, %d, %hd): stub\n",
128 rClsid, fIsLinkedObject, wFormat
129 );
130 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
131 return FALSE;
132 }
133
134 /***********************************************************************
135 * OleUIInsertObjectW (OLEDLG.20)
136 */
137 UINT WINAPI OleUIInsertObjectW(LPOLEUIINSERTOBJECTW lpOleUIInsertObject)
138 {
139 FIXME("(%p): stub\n", lpOleUIInsertObject);
140 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
141 return OLEUI_FALSE;
142 }
143
144 /***********************************************************************
145 * OleUIEditLinksA (OLEDLG.5)
146 */
147 UINT WINAPI OleUIEditLinksA(LPOLEUIEDITLINKSA lpOleUIEditLinks)
148 {
149 FIXME("(%p): stub\n", lpOleUIEditLinks);
150 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
151 return OLEUI_FALSE;
152 }
153
154 /***********************************************************************
155 * OleUIEditLinksW (OLEDLG.19)
156 */
157 UINT WINAPI OleUIEditLinksW(LPOLEUIEDITLINKSW lpOleUIEditLinks)
158 {
159 FIXME("(%p): stub\n", lpOleUIEditLinks);
160 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
161 return OLEUI_FALSE;
162 }
163
164 /***********************************************************************
165 * OleUIChangeIconA (OLEDLG.6)
166 */
167 UINT WINAPI OleUIChangeIconA(
168 LPOLEUICHANGEICONA lpOleUIChangeIcon)
169 {
170 FIXME("(%p): stub\n", lpOleUIChangeIcon);
171 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
172 return OLEUI_FALSE;
173 }
174
175 /***********************************************************************
176 * OleUIChangeIconW (OLEDLG.16)
177 */
178 UINT WINAPI OleUIChangeIconW(
179 LPOLEUICHANGEICONW lpOleUIChangeIcon)
180 {
181 FIXME("(%p): stub\n", lpOleUIChangeIcon);
182 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
183 return OLEUI_FALSE;
184 }
185
186 /***********************************************************************
187 * OleUIConvertA (OLEDLG.7)
188 */
189 UINT WINAPI OleUIConvertA(LPOLEUICONVERTA lpOleUIConvert)
190 {
191 FIXME("(%p): stub\n", lpOleUIConvert);
192 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
193 return OLEUI_FALSE;
194 }
195
196 /***********************************************************************
197 * OleUIConvertW (OLEDLG.18)
198 */
199 UINT WINAPI OleUIConvertW(LPOLEUICONVERTW lpOleUIConvert)
200 {
201 FIXME("(%p): stub\n", lpOleUIConvert);
202 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
203 return OLEUI_FALSE;
204 }
205
206 /***********************************************************************
207 * OleUIBusyA (OLEDLG.8)
208 */
209 UINT WINAPI OleUIBusyA(LPOLEUIBUSYA lpOleUIBusy)
210 {
211 FIXME("(%p): stub\n", lpOleUIBusy);
212 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
213 return OLEUI_FALSE;
214 }
215
216 /***********************************************************************
217 * OleUIBusyW (OLEDLG.15)
218 */
219 UINT WINAPI OleUIBusyW(LPOLEUIBUSYW lpOleUIBusy)
220 {
221 FIXME("(%p): stub\n", lpOleUIBusy);
222 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
223 return OLEUI_FALSE;
224 }
225
226 /***********************************************************************
227 * OleUIUpdateLinksA (OLEDLG.9)
228 */
229 BOOL WINAPI OleUIUpdateLinksA(
230 LPOLEUILINKCONTAINERA lpOleUILinkCntr,
231 HWND hwndParent, LPSTR lpszTitle, INT cLinks)
232 {
233 FIXME("(%p, %p, %s, %d): stub\n",
234 lpOleUILinkCntr, hwndParent, debugstr_a(lpszTitle), cLinks
235 );
236 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
237 return FALSE;
238 }
239
240 /***********************************************************************
241 * OleUIUpdateLinksW (OLEDLG.23)
242 */
243 BOOL WINAPI OleUIUpdateLinksW(
244 LPOLEUILINKCONTAINERW lpOleUILinkCntr,
245 HWND hwndParent, LPWSTR lpszTitle, INT cLinks)
246 {
247 FIXME("(%p, %p, %s, %d): stub\n",
248 lpOleUILinkCntr, hwndParent, debugstr_w(lpszTitle), cLinks
249 );
250 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
251 return FALSE;
252 }
253
254 /***********************************************************************
255 * OleUIPromptUserA (OLEDLG.10)
256 */
257 INT WINAPIV OleUIPromptUserA(
258 INT nTemplate, HWND hwndParent, ...)
259 {
260 FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
261 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
262 return OLEUI_FALSE;
263 }
264
265 /***********************************************************************
266 * OleUIPromptUserW (OLEDLG.13)
267 */
268 INT WINAPIV OleUIPromptUserW(
269 INT nTemplate, HWND hwndParent, ...)
270 {
271 FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
272 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
273 return OLEUI_FALSE;
274 }
275
276 /***********************************************************************
277 * OleUIObjectPropertiesA (OLEDLG.11)
278 */
279 UINT WINAPI OleUIObjectPropertiesA(
280 LPOLEUIOBJECTPROPSA lpOleUIObjectProps)
281 {
282 FIXME("(%p): stub\n", lpOleUIObjectProps);
283 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
284 return OLEUI_FALSE;
285 }
286
287 /***********************************************************************
288 * OleUIObjectPropertiesW (OLEDLG.21)
289 */
290 UINT WINAPI OleUIObjectPropertiesW(
291 LPOLEUIOBJECTPROPSW lpOleUIObjectProps)
292 {
293 FIXME("(%p): stub\n", lpOleUIObjectProps);
294 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
295 return OLEUI_FALSE;
296 }
297
298 /***********************************************************************
299 * OleUIChangeSourceA (OLEDLG.12)
300 */
301 UINT WINAPI OleUIChangeSourceA(
302 LPOLEUICHANGESOURCEA lpOleUIChangeSource)
303 {
304 FIXME("(%p): stub\n", lpOleUIChangeSource);
305 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
306 return OLEUI_FALSE;
307 }
308
309 /***********************************************************************
310 * OleUIChangeSourceW (OLEDLG.17)
311 */
312 UINT WINAPI OleUIChangeSourceW(
313 LPOLEUICHANGESOURCEW lpOleUIChangeSource)
314 {
315 FIXME("(%p): stub\n", lpOleUIChangeSource);
316 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
317 return OLEUI_FALSE;
318 }