oledlg_main.c 10.3 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2 3 4
/*
 *	OLEDLG library
 *
 *	Copyright 1998	Patrik Stridvall
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
Alexandre Julliard's avatar
Alexandre Julliard committed
19 20
 */

21 22
#include <stdarg.h>

23
#include "windef.h"
24
#include "winbase.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
25
#include "winerror.h"
26 27
#include "wingdi.h"
#include "winuser.h"
Alexandre Julliard's avatar
Alexandre Julliard committed
28
#include "oledlg.h"
29
#include "ole2.h"
30 31 32
#include "oledlg_private.h"

#include "wine/debug.h"
33

34
WINE_DEFAULT_DEBUG_CHANNEL(ole);
Patrik Stridvall's avatar
Patrik Stridvall committed
35

36 37
HINSTANCE OLEDLG_hInstance = 0;

38 39 40 41 42 43 44 45 46
UINT cf_embed_source;
UINT cf_embedded_object;
UINT cf_link_source;
UINT cf_object_descriptor;
UINT cf_link_src_descriptor;
UINT cf_ownerlink;
UINT cf_filename;
UINT cf_filenamew;

47 48 49
UINT oleui_msg_help;
UINT oleui_msg_enddialog;

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
static void register_clipboard_formats(void)
{
    /* These used to be declared in olestd.h, but that seems to have been removed from the api */
    static const WCHAR CF_EMBEDSOURCEW[]          = { 'E','m','b','e','d',' ','S','o','u','r','c','e',0 };
    static const WCHAR CF_EMBEDDEDOBJECTW[]       = { 'E','m','b','e','d','d','e','d',' ','O','b','j','e','c','t',0 };
    static const WCHAR CF_LINKSOURCEW[]           = { 'L','i','n','k',' ','S','o','u','r','c','e',0 };
    static const WCHAR CF_OBJECTDESCRIPTORW[]     = { 'O','b','j','e','c','t',' ','D','e','s','c','r','i','p','t','o','r',0 };
    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 };
    static const WCHAR CF_OWNERLINKW[]            = { 'O','w','n','e','r','L','i','n','k',0 };
    static const WCHAR CF_FILENAMEW[]             = { 'F','i','l','e','N','a','m','e',0 };
    static const WCHAR CF_FILENAMEWW[]            = { 'F','i','l','e','N','a','m','e','W',0 };

    /* Load in the same order as native to make debugging easier */
    cf_object_descriptor    = RegisterClipboardFormatW(CF_OBJECTDESCRIPTORW);
    cf_link_src_descriptor  = RegisterClipboardFormatW(CF_LINKSRCDESCRIPTORW);
    cf_embed_source         = RegisterClipboardFormatW(CF_EMBEDSOURCEW);
    cf_embedded_object      = RegisterClipboardFormatW(CF_EMBEDDEDOBJECTW);
    cf_link_source          = RegisterClipboardFormatW(CF_LINKSOURCEW);
    cf_ownerlink            = RegisterClipboardFormatW(CF_OWNERLINKW);
    cf_filename             = RegisterClipboardFormatW(CF_FILENAMEW);
    cf_filenamew            = RegisterClipboardFormatW(CF_FILENAMEWW);
}

73 74 75 76 77 78
static void register_messages(void)
{
    oleui_msg_help             = RegisterWindowMessageW(SZOLEUI_MSG_HELPW);
    oleui_msg_enddialog        = RegisterWindowMessageW(SZOLEUI_MSG_ENDDIALOGW);
}

79 80 81 82 83
/***********************************************************************
 *		DllMain
 */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
84
    TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
85 86 87 88 89

    switch(fdwReason) {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hinstDLL);
        OLEDLG_hInstance = hinstDLL;
90
        register_clipboard_formats();
91
        register_messages();
92 93 94 95 96 97 98 99 100 101
        break;

    case DLL_PROCESS_DETACH:
        OLEDLG_hInstance = 0;
        break;
    }
    return TRUE;
}


Alexandre Julliard's avatar
Alexandre Julliard committed
102
/***********************************************************************
103
 *           OleUIAddVerbMenuA (OLEDLG.1)
Alexandre Julliard's avatar
Alexandre Julliard committed
104
 */
105
BOOL WINAPI OleUIAddVerbMenuA(
Alexandre Julliard's avatar
Alexandre Julliard committed
106
  LPOLEOBJECT lpOleObj, LPCSTR lpszShortType,
107 108
  HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
  BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
Alexandre Julliard's avatar
Alexandre Julliard committed
109
{
110
  FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
Alexandre Julliard's avatar
Alexandre Julliard committed
111 112 113
    lpOleObj, debugstr_a(lpszShortType),
    hMenu, uPos, uIDVerbMin, uIDVerbMax,
    bAddConvert, idConvert, lphMenu
Alexandre Julliard's avatar
Alexandre Julliard committed
114 115 116 117 118 119
  );
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return FALSE;
}

/***********************************************************************
120
 *           OleUIAddVerbMenuW (OLEDLG.14)
Alexandre Julliard's avatar
Alexandre Julliard committed
121
 */
122
BOOL WINAPI OleUIAddVerbMenuW(
Alexandre Julliard's avatar
Alexandre Julliard committed
123
  LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType,
124 125
  HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
  BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
Alexandre Julliard's avatar
Alexandre Julliard committed
126
{
127
  FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
Alexandre Julliard's avatar
Alexandre Julliard committed
128 129 130
    lpOleObj, debugstr_w(lpszShortType),
    hMenu, uPos, uIDVerbMin, uIDVerbMax,
    bAddConvert, idConvert, lphMenu
Alexandre Julliard's avatar
Alexandre Julliard committed
131 132 133 134 135 136
  );
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return FALSE;
}

/***********************************************************************
137
 *           OleUICanConvertOrActivateAs (OLEDLG.2)
Alexandre Julliard's avatar
Alexandre Julliard committed
138
 */
139 140
BOOL WINAPI OleUICanConvertOrActivateAs(
    REFCLSID rClsid, BOOL fIsLinkedObject, WORD wFormat)
Alexandre Julliard's avatar
Alexandre Julliard committed
141
{
142
  FIXME("(%p, %d, %hd): stub\n",
Alexandre Julliard's avatar
Alexandre Julliard committed
143 144
    rClsid, fIsLinkedObject, wFormat
  );
Alexandre Julliard's avatar
Alexandre Julliard committed
145 146 147 148 149
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return FALSE;
}

/***********************************************************************
150
 *           OleUIInsertObjectW (OLEDLG.20)
Alexandre Julliard's avatar
Alexandre Julliard committed
151
 */
152
UINT WINAPI OleUIInsertObjectW(LPOLEUIINSERTOBJECTW lpOleUIInsertObject)
Alexandre Julliard's avatar
Alexandre Julliard committed
153
{
154
  FIXME("(%p): stub\n", lpOleUIInsertObject);
Alexandre Julliard's avatar
Alexandre Julliard committed
155 156 157 158 159
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
160
 *           OleUIEditLinksA (OLEDLG.5)
Alexandre Julliard's avatar
Alexandre Julliard committed
161
 */
162
UINT WINAPI OleUIEditLinksA(LPOLEUIEDITLINKSA lpOleUIEditLinks)
Alexandre Julliard's avatar
Alexandre Julliard committed
163
{
164
  FIXME("(%p): stub\n", lpOleUIEditLinks);
Alexandre Julliard's avatar
Alexandre Julliard committed
165 166 167 168 169
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
170
 *           OleUIEditLinksW (OLEDLG.19)
Alexandre Julliard's avatar
Alexandre Julliard committed
171
 */
172
UINT WINAPI OleUIEditLinksW(LPOLEUIEDITLINKSW lpOleUIEditLinks)
Alexandre Julliard's avatar
Alexandre Julliard committed
173
{
174
  FIXME("(%p): stub\n", lpOleUIEditLinks);
Alexandre Julliard's avatar
Alexandre Julliard committed
175 176 177 178 179
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
180
 *           OleUIChangeIconA (OLEDLG.6)
Alexandre Julliard's avatar
Alexandre Julliard committed
181
 */
182 183
UINT WINAPI OleUIChangeIconA(
  LPOLEUICHANGEICONA lpOleUIChangeIcon)
Alexandre Julliard's avatar
Alexandre Julliard committed
184
{
185
  FIXME("(%p): stub\n", lpOleUIChangeIcon);
Alexandre Julliard's avatar
Alexandre Julliard committed
186 187 188 189 190
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
191
 *           OleUIChangeIconW (OLEDLG.16)
Alexandre Julliard's avatar
Alexandre Julliard committed
192
 */
193 194
UINT WINAPI OleUIChangeIconW(
  LPOLEUICHANGEICONW lpOleUIChangeIcon)
Alexandre Julliard's avatar
Alexandre Julliard committed
195
{
196
  FIXME("(%p): stub\n", lpOleUIChangeIcon);
Alexandre Julliard's avatar
Alexandre Julliard committed
197 198 199 200 201
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
202
 *           OleUIConvertA (OLEDLG.7)
Alexandre Julliard's avatar
Alexandre Julliard committed
203
 */
204
UINT WINAPI OleUIConvertA(LPOLEUICONVERTA lpOleUIConvert)
Alexandre Julliard's avatar
Alexandre Julliard committed
205
{
206
  FIXME("(%p): stub\n", lpOleUIConvert);
Alexandre Julliard's avatar
Alexandre Julliard committed
207 208 209 210 211
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
212
 *           OleUIConvertW (OLEDLG.18)
Alexandre Julliard's avatar
Alexandre Julliard committed
213
 */
214
UINT WINAPI OleUIConvertW(LPOLEUICONVERTW lpOleUIConvert)
Alexandre Julliard's avatar
Alexandre Julliard committed
215
{
216
  FIXME("(%p): stub\n", lpOleUIConvert);
Alexandre Julliard's avatar
Alexandre Julliard committed
217 218 219 220 221
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
222
 *           OleUIBusyA (OLEDLG.8)
Alexandre Julliard's avatar
Alexandre Julliard committed
223
 */
224
UINT WINAPI OleUIBusyA(LPOLEUIBUSYA lpOleUIBusy)
Alexandre Julliard's avatar
Alexandre Julliard committed
225
{
226
  FIXME("(%p): stub\n", lpOleUIBusy);
Alexandre Julliard's avatar
Alexandre Julliard committed
227 228 229 230 231
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
232
 *           OleUIBusyW (OLEDLG.15)
Alexandre Julliard's avatar
Alexandre Julliard committed
233
 */
234
UINT WINAPI OleUIBusyW(LPOLEUIBUSYW lpOleUIBusy)
Alexandre Julliard's avatar
Alexandre Julliard committed
235
{
236
  FIXME("(%p): stub\n", lpOleUIBusy);
Alexandre Julliard's avatar
Alexandre Julliard committed
237 238 239 240 241
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
242
 *           OleUIUpdateLinksA (OLEDLG.9)
Alexandre Julliard's avatar
Alexandre Julliard committed
243
 */
244 245 246
BOOL WINAPI OleUIUpdateLinksA(
  LPOLEUILINKCONTAINERA lpOleUILinkCntr,
  HWND hwndParent, LPSTR lpszTitle, INT cLinks)
Alexandre Julliard's avatar
Alexandre Julliard committed
247
{
248
  FIXME("(%p, %p, %s, %d): stub\n",
Alexandre Julliard's avatar
Alexandre Julliard committed
249 250
    lpOleUILinkCntr, hwndParent, debugstr_a(lpszTitle), cLinks
  );
Alexandre Julliard's avatar
Alexandre Julliard committed
251 252 253 254 255
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return FALSE;
}

/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
256
 *           OleUIUpdateLinksW (OLEDLG.23)
Alexandre Julliard's avatar
Alexandre Julliard committed
257
 */
258 259 260
BOOL WINAPI OleUIUpdateLinksW(
  LPOLEUILINKCONTAINERW lpOleUILinkCntr,
  HWND hwndParent, LPWSTR lpszTitle, INT cLinks)
Alexandre Julliard's avatar
Alexandre Julliard committed
261
{
262
  FIXME("(%p, %p, %s, %d): stub\n",
Alexandre Julliard's avatar
Alexandre Julliard committed
263 264
    lpOleUILinkCntr, hwndParent, debugstr_w(lpszTitle), cLinks
  );
Alexandre Julliard's avatar
Alexandre Julliard committed
265 266 267 268 269
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return FALSE;
}

/***********************************************************************
270
 *           OleUIPromptUserA (OLEDLG.10)
Alexandre Julliard's avatar
Alexandre Julliard committed
271
 */
272
INT WINAPIV OleUIPromptUserA(
273
  INT nTemplate, HWND hwndParent, ...)
Alexandre Julliard's avatar
Alexandre Julliard committed
274
{
275
  FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
Alexandre Julliard's avatar
Alexandre Julliard committed
276 277 278 279 280
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
281
 *           OleUIPromptUserW (OLEDLG.13)
Alexandre Julliard's avatar
Alexandre Julliard committed
282
 */
283
INT WINAPIV OleUIPromptUserW(
284
  INT nTemplate, HWND hwndParent, ...)
Alexandre Julliard's avatar
Alexandre Julliard committed
285
{
286
  FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
Alexandre Julliard's avatar
Alexandre Julliard committed
287 288 289 290 291
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
292
 *           OleUIObjectPropertiesA (OLEDLG.11)
Alexandre Julliard's avatar
Alexandre Julliard committed
293
 */
294 295
UINT WINAPI OleUIObjectPropertiesA(
  LPOLEUIOBJECTPROPSA lpOleUIObjectProps)
Alexandre Julliard's avatar
Alexandre Julliard committed
296
{
297
  FIXME("(%p): stub\n", lpOleUIObjectProps);
Alexandre Julliard's avatar
Alexandre Julliard committed
298 299 300 301 302
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
303
 *           OleUIObjectPropertiesW (OLEDLG.21)
Alexandre Julliard's avatar
Alexandre Julliard committed
304
 */
305 306
UINT WINAPI OleUIObjectPropertiesW(
  LPOLEUIOBJECTPROPSW lpOleUIObjectProps)
Alexandre Julliard's avatar
Alexandre Julliard committed
307
{
308
  FIXME("(%p): stub\n", lpOleUIObjectProps);
Alexandre Julliard's avatar
Alexandre Julliard committed
309 310 311 312 313
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
314
 *           OleUIChangeSourceA (OLEDLG.12)
Alexandre Julliard's avatar
Alexandre Julliard committed
315
 */
316 317
UINT WINAPI OleUIChangeSourceA(
  LPOLEUICHANGESOURCEA lpOleUIChangeSource)
Alexandre Julliard's avatar
Alexandre Julliard committed
318
{
319
  FIXME("(%p): stub\n", lpOleUIChangeSource);
Alexandre Julliard's avatar
Alexandre Julliard committed
320 321 322 323 324
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}

/***********************************************************************
325
 *           OleUIChangeSourceW (OLEDLG.17)
Alexandre Julliard's avatar
Alexandre Julliard committed
326
 */
327 328
UINT WINAPI OleUIChangeSourceW(
  LPOLEUICHANGESOURCEW lpOleUIChangeSource)
Alexandre Julliard's avatar
Alexandre Julliard committed
329
{
330
  FIXME("(%p): stub\n", lpOleUIChangeSource);
Alexandre Julliard's avatar
Alexandre Julliard committed
331 332 333
  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
  return OLEUI_FALSE;
}