4 * Copyright 2000 Huw D M Davies for Codeweavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "ole32_main.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(ole);
31 HINSTANCE OLE32_hInstance = 0;
33 /***********************************************************************
34 * OleMetafilePictFromIconAndLabel (OLE32.115)
36 HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLabel,
37 LPOLESTR lpszSourceFile, UINT iIconIndex)
45 TRACE("%p %p %p %d\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex);
50 hdc = CreateMetaFileW(NULL);
54 /* FIXME: things are drawn in the wrong place */
55 DrawIcon(hdc, 0, 0, hIcon);
56 dy = GetSystemMetrics(SM_CXICON);
58 TextOutW(hdc, 0, dy, lpszLabel, lstrlenW(lpszLabel));
60 hmf = CloseMetaFile(hdc);
64 mfsize = GetMetaFileBitsEx( hmf, 0, NULL);
68 hmem = GlobalAlloc( GMEM_MOVEABLE, mfsize );
72 mfdata = GlobalLock( hmem );
80 GetMetaFileBitsEx( hmf, mfsize, mfdata );
85 TRACE("returning %p\n",hmem);
91 /***********************************************************************
94 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
96 TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
99 case DLL_PROCESS_ATTACH:
100 OLE32_hInstance = hinstDLL;
101 COMPOBJ_InitProcess();
102 if (TRACE_ON(ole)) CoRegisterMallocSpy((LPVOID)-1);
105 case DLL_PROCESS_DETACH:
106 if (TRACE_ON(ole)) CoRevokeMallocSpy();
107 COMPOBJ_UninitProcess();
114 /* NOTE: DllRegisterServer and DllUnregisterServer are in regsvr.c */