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
28 #include "ole32_main.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(ole);
33 HINSTANCE OLE32_hInstance = 0;
35 /***********************************************************************
36 * OleMetafilePictFromIconAndLabel (OLE32.115)
38 HGLOBAL WINAPI OleMetafilePictFromIconAndLabel(HICON hIcon, LPOLESTR lpszLabel,
39 LPOLESTR lpszSourceFile, UINT iIconIndex)
47 TRACE("%p %p %p %d\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex);
52 hdc = CreateMetaFileW(NULL);
56 /* FIXME: things are drawn in the wrong place */
57 DrawIcon(hdc, 0, 0, hIcon);
58 dy = GetSystemMetrics(SM_CXICON);
60 TextOutW(hdc, 0, dy, lpszLabel, lstrlenW(lpszLabel));
62 hmf = CloseMetaFile(hdc);
66 mfsize = GetMetaFileBitsEx( hmf, 0, NULL);
70 hmem = GlobalAlloc( GMEM_MOVEABLE, mfsize );
74 mfdata = GlobalLock( hmem );
82 GetMetaFileBitsEx( hmf, mfsize, mfdata );
87 TRACE("returning %p\n",hmem);
93 /***********************************************************************
96 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
98 TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
101 case DLL_PROCESS_ATTACH:
102 DisableThreadLibraryCalls(hinstDLL);
103 OLE32_hInstance = hinstDLL;
104 COMPOBJ_InitProcess();
105 if (TRACE_ON(ole)) CoRegisterMallocSpy((LPVOID)-1);
108 case DLL_PROCESS_DETACH:
109 if (TRACE_ON(ole)) CoRevokeMallocSpy();
110 COMPOBJ_UninitProcess();
117 /* NOTE: DllRegisterServer and DllUnregisterServer are in regsvr.c */