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