2003-07-09 21:49:12 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* OLE2 library - 16 bit only interfaces
|
|
|
|
*
|
|
|
|
* Copyright 1995 Martin von Loewis
|
|
|
|
* Copyright 1999 Francis Beaudet
|
|
|
|
* Copyright 1999 Noel Borthwick
|
|
|
|
*
|
|
|
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2003-07-09 21:49:12 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define NONAMELESSSTRUCT
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winnls.h"
|
2003-07-09 21:49:12 +02:00
|
|
|
#include "commctrl.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "ole2ver.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "wownt32.h"
|
|
|
|
|
|
|
|
#include "wine/winbase16.h"
|
|
|
|
#include "wine/wingdi16.h"
|
|
|
|
#include "wine/winuser16.h"
|
|
|
|
#include "ole32_main.h"
|
2004-01-23 23:51:41 +01:00
|
|
|
#include "ifs.h"
|
2003-07-09 21:49:12 +02:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(accel);
|
|
|
|
|
|
|
|
#define HICON_16(h32) (LOWORD(h32))
|
|
|
|
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
|
|
|
|
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RegisterDragDrop (OLE2.35)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI RegisterDragDrop16(
|
|
|
|
HWND16 hwnd,
|
|
|
|
LPDROPTARGET pDropTarget
|
|
|
|
) {
|
|
|
|
FIXME("(0x%04x,%p),stub!\n",hwnd,pDropTarget);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* RevokeDragDrop (OLE2.36)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI RevokeDragDrop16(
|
|
|
|
HWND16 hwnd
|
|
|
|
) {
|
|
|
|
FIXME("(0x%04x),stub!\n",hwnd);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* OleMetaFilePictFromIconAndLabel (OLE2.56)
|
|
|
|
*
|
|
|
|
* Returns a global memory handle to a metafile which contains the icon and
|
|
|
|
* label given.
|
|
|
|
* I guess the result of that should look somehow like desktop icons.
|
|
|
|
* If no hIcon is given, we load the icon via lpszSourceFile and iIconIndex.
|
|
|
|
* This code might be wrong at some places.
|
|
|
|
*/
|
|
|
|
HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
|
|
|
|
HICON16 hIcon,
|
|
|
|
LPCOLESTR16 lpszLabel,
|
|
|
|
LPCOLESTR16 lpszSourceFile,
|
|
|
|
UINT16 iIconIndex
|
|
|
|
) {
|
2005-04-13 17:16:40 +02:00
|
|
|
METAFILEPICT16 *mf16;
|
|
|
|
HGLOBAL16 hmf16;
|
|
|
|
HMETAFILE hmf;
|
|
|
|
INT mfSize;
|
2003-07-09 21:49:12 +02:00
|
|
|
HDC hdc;
|
|
|
|
|
|
|
|
if (!hIcon) {
|
|
|
|
if (lpszSourceFile) {
|
|
|
|
HINSTANCE16 hInstance = LoadLibrary16(lpszSourceFile);
|
|
|
|
|
|
|
|
/* load the icon at index from lpszSourceFile */
|
|
|
|
hIcon = HICON_16(LoadIconA(HINSTANCE_32(hInstance), (LPCSTR)(DWORD)iIconIndex));
|
|
|
|
FreeLibrary16(hInstance);
|
|
|
|
} else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-13 17:16:40 +02:00
|
|
|
FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n",
|
|
|
|
hIcon, lpszLabel, lpszSourceFile, iIconIndex);
|
|
|
|
|
|
|
|
hdc = CreateMetaFileW(NULL);
|
2003-07-09 21:49:12 +02:00
|
|
|
DrawIcon(hdc, 0, 0, HICON_32(hIcon)); /* FIXME */
|
|
|
|
TextOutA(hdc, 0, 0, lpszLabel, 1); /* FIXME */
|
2005-04-13 17:16:40 +02:00
|
|
|
hmf = CloseMetaFile(hdc);
|
|
|
|
|
|
|
|
hmf16 = GlobalAlloc16(0, sizeof(METAFILEPICT16));
|
|
|
|
mf16 = (METAFILEPICT16 *)GlobalLock16(hmf16);
|
|
|
|
mf16->mm = MM_ANISOTROPIC;
|
|
|
|
mf16->xExt = 20; /* FIXME: bogus */
|
|
|
|
mf16->yExt = 20; /* dito */
|
|
|
|
mfSize = GetMetaFileBitsEx(hmf, 0, 0);
|
|
|
|
mf16->hMF = GlobalAlloc16(GMEM_MOVEABLE, mfSize);
|
|
|
|
if(mf16->hMF)
|
|
|
|
{
|
|
|
|
GetMetaFileBitsEx(hmf, mfSize, GlobalLock16(mf16->hMF));
|
|
|
|
GlobalUnlock16(mf16->hMF);
|
|
|
|
}
|
|
|
|
return hmf16;
|
2003-07-09 21:49:12 +02:00
|
|
|
}
|
2004-01-23 23:51:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* CreateItemMoniker (OLE2.27)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR16 lpszItem,LPMONIKER* ppmk)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p),stub!\n",lpszDelim,ppmk);
|
|
|
|
*ppmk = NULL;
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* CreateFileMoniker (OLE2.28)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p),stub!\n",lpszPathName,ppmk);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|