From bed39b45ee38273e034bfc1113d8da26bdde069b Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 18 Oct 2006 16:47:48 +0100 Subject: [PATCH] oledlg: Register a bunch of clipboard formats. --- dlls/oledlg/oledlg_main.c | 37 +++++++++++++++++++++++++++++++++++- dlls/oledlg/oledlg_private.h | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 dlls/oledlg/oledlg_private.h diff --git a/dlls/oledlg/oledlg_main.c b/dlls/oledlg/oledlg_main.c index 4ff4cfbc105..6ee2de97b64 100644 --- a/dlls/oledlg/oledlg_main.c +++ b/dlls/oledlg/oledlg_main.c @@ -27,13 +27,47 @@ #include "wingdi.h" #include "winuser.h" #include "oledlg.h" -#include "wine/debug.h" #include "ole2.h" +#include "oledlg_private.h" + +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); HINSTANCE OLEDLG_hInstance = 0; +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; + +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); +} + /*********************************************************************** * DllMain */ @@ -45,6 +79,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); OLEDLG_hInstance = hinstDLL; + register_clipboard_formats(); break; case DLL_PROCESS_DETACH: diff --git a/dlls/oledlg/oledlg_private.h b/dlls/oledlg/oledlg_private.h new file mode 100644 index 00000000000..671eb3edba7 --- /dev/null +++ b/dlls/oledlg/oledlg_private.h @@ -0,0 +1,33 @@ +/* + * oledlg internal header file + * + * Copyright (C) 2006 Huw Davies + * + * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __OLEDLG_PRIVATE_H__ +#define __OLEDLG_PRIVATE_H__ + +extern UINT cf_embed_source; +extern UINT cf_embedded_object; +extern UINT cf_link_source; +extern UINT cf_object_descriptor; +extern UINT cf_link_src_descriptor; +extern UINT cf_ownerlink; +extern UINT cf_filename; +extern UINT cf_filenamew; + +#endif /* __OLEDLG_PRIVATE_H__ */