oledlg_main.c 10.2 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
        break;
    }
    return TRUE;
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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