3 * OLE2 library - 16 bit only interfaces
5 * Copyright 1995 Martin von Loewis
6 * Copyright 1999 Francis Beaudet
7 * Copyright 1999 Noel Borthwick
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
45 #include "wine/winbase16.h"
46 #include "wine/wingdi16.h"
47 #include "wine/winuser16.h"
48 #include "ole32_main.h"
50 #include "wine/debug.h"
52 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
53 WINE_DECLARE_DEBUG_CHANNEL(accel
);
55 #define HICON_16(h32) (LOWORD(h32))
56 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
57 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
59 /***********************************************************************
60 * RegisterDragDrop (OLE2.35)
62 HRESULT WINAPI
RegisterDragDrop16(
64 LPDROPTARGET pDropTarget
66 FIXME("(0x%04x,%p),stub!\n",hwnd
,pDropTarget
);
70 /***********************************************************************
71 * RevokeDragDrop (OLE2.36)
73 HRESULT WINAPI
RevokeDragDrop16(
76 FIXME("(0x%04x),stub!\n",hwnd
);
80 /******************************************************************************
81 * OleMetaFilePictFromIconAndLabel (OLE2.56)
83 * Returns a global memory handle to a metafile which contains the icon and
85 * I guess the result of that should look somehow like desktop icons.
86 * If no hIcon is given, we load the icon via lpszSourceFile and iIconIndex.
87 * This code might be wrong at some places.
89 HGLOBAL16 WINAPI
OleMetaFilePictFromIconAndLabel16(
91 LPCOLESTR16 lpszLabel
,
92 LPCOLESTR16 lpszSourceFile
,
99 FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n\n\n", hIcon
, lpszLabel
, lpszSourceFile
, iIconIndex
);
102 if (lpszSourceFile
) {
103 HINSTANCE16 hInstance
= LoadLibrary16(lpszSourceFile
);
105 /* load the icon at index from lpszSourceFile */
106 hIcon
= HICON_16(LoadIconA(HINSTANCE_32(hInstance
), (LPCSTR
)(DWORD
)iIconIndex
));
107 FreeLibrary16(hInstance
);
112 hdc
= CreateMetaFileA(NULL
);
113 DrawIcon(hdc
, 0, 0, HICON_32(hIcon
)); /* FIXME */
114 TextOutA(hdc
, 0, 0, lpszLabel
, 1); /* FIXME */
115 hmf
= GlobalAlloc16(0, sizeof(METAFILEPICT16
));
116 mf
= (METAFILEPICT16
*)GlobalLock16(hmf
);
117 mf
->mm
= MM_ANISOTROPIC
;
118 mf
->xExt
= 20; /* FIXME: bogus */
119 mf
->yExt
= 20; /* dito */
120 mf
->hMF
= CloseMetaFile16(HDC_16(hdc
));