Fixed typo.
[wine.git] / dlls / ole32 / ole2_16.c
blob67514ead8014c2f9c667b3a7f4acd0796b939f56
2 /*
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
24 #include "config.h"
26 #include <assert.h>
27 #include <stdlib.h>
28 #include <stdarg.h>
29 #include <stdio.h>
30 #include <string.h>
32 #define NONAMELESSUNION
33 #define NONAMELESSSTRUCT
34 #include "windef.h"
35 #include "winbase.h"
36 #include "wingdi.h"
37 #include "winuser.h"
38 #include "winnls.h"
39 #include "commctrl.h"
40 #include "ole2.h"
41 #include "ole2ver.h"
42 #include "winerror.h"
43 #include "wownt32.h"
45 #include "wine/winbase16.h"
46 #include "wine/wingdi16.h"
47 #include "wine/winuser16.h"
48 #include "ole32_main.h"
49 #include "ifs.h"
51 #include "wine/debug.h"
53 WINE_DEFAULT_DEBUG_CHANNEL(ole);
54 WINE_DECLARE_DEBUG_CHANNEL(accel);
56 #define HICON_16(h32) (LOWORD(h32))
57 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
58 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
60 /***********************************************************************
61 * RegisterDragDrop (OLE2.35)
63 HRESULT WINAPI RegisterDragDrop16(
64 HWND16 hwnd,
65 LPDROPTARGET pDropTarget
66 ) {
67 FIXME("(0x%04x,%p),stub!\n",hwnd,pDropTarget);
68 return S_OK;
71 /***********************************************************************
72 * RevokeDragDrop (OLE2.36)
74 HRESULT WINAPI RevokeDragDrop16(
75 HWND16 hwnd
76 ) {
77 FIXME("(0x%04x),stub!\n",hwnd);
78 return S_OK;
81 /******************************************************************************
82 * OleMetaFilePictFromIconAndLabel (OLE2.56)
84 * Returns a global memory handle to a metafile which contains the icon and
85 * label given.
86 * I guess the result of that should look somehow like desktop icons.
87 * If no hIcon is given, we load the icon via lpszSourceFile and iIconIndex.
88 * This code might be wrong at some places.
90 HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
91 HICON16 hIcon,
92 LPCOLESTR16 lpszLabel,
93 LPCOLESTR16 lpszSourceFile,
94 UINT16 iIconIndex
95 ) {
96 METAFILEPICT16 *mf;
97 HGLOBAL16 hmf;
98 HDC hdc;
100 FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n\n\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex);
102 if (!hIcon) {
103 if (lpszSourceFile) {
104 HINSTANCE16 hInstance = LoadLibrary16(lpszSourceFile);
106 /* load the icon at index from lpszSourceFile */
107 hIcon = HICON_16(LoadIconA(HINSTANCE_32(hInstance), (LPCSTR)(DWORD)iIconIndex));
108 FreeLibrary16(hInstance);
109 } else
110 return 0;
113 hdc = CreateMetaFileA(NULL);
114 DrawIcon(hdc, 0, 0, HICON_32(hIcon)); /* FIXME */
115 TextOutA(hdc, 0, 0, lpszLabel, 1); /* FIXME */
116 hmf = GlobalAlloc16(0, sizeof(METAFILEPICT16));
117 mf = (METAFILEPICT16 *)GlobalLock16(hmf);
118 mf->mm = MM_ANISOTROPIC;
119 mf->xExt = 20; /* FIXME: bogus */
120 mf->yExt = 20; /* dito */
121 mf->hMF = CloseMetaFile16(HDC_16(hdc));
122 return hmf;
126 /******************************************************************************
127 * CreateItemMoniker (OLE2.27)
129 HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR16 lpszItem,LPMONIKER* ppmk)
131 FIXME("(%s,%p),stub!\n",lpszDelim,ppmk);
132 *ppmk = NULL;
133 return E_NOTIMPL;
137 /******************************************************************************
138 * CreateFileMoniker (OLE2.28)
140 HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk)
142 FIXME("(%s,%p),stub!\n",lpszPathName,ppmk);
143 return E_NOTIMPL;