Rob Shearman : ole32: Fill in the xExt and yExt fields in OleMetafilePictFromIconAndLabel.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 4 07:16:55 CST 2006


Module: wine
Branch: master
Commit: cdb86c6c90ca37884f64e39473d7d8a77bd53ce1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cdb86c6c90ca37884f64e39473d7d8a77bd53ce1

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Dec  1 15:05:30 2006 +0000

ole32: Fill in the xExt and yExt fields in OleMetafilePictFromIconAndLabel.

---

 dlls/ole32/ole32_main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/ole32_main.c b/dlls/ole32/ole32_main.c
index 377aa4d..493d246 100644
--- a/dlls/ole32/ole32_main.c
+++ b/dlls/ole32/ole32_main.c
@@ -32,6 +32,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(ole);
 
+#define HIMETRIC_INCHES 2540
+
 /***********************************************************************
  *		OleMetafilePictFromIconAndLabel (OLE32.@)
  */
@@ -120,7 +122,10 @@ HGLOBAL WINAPI OleMetafilePictFromIconAn
 	}
 
 	mfp.mm = MM_ANISOTROPIC;
-	mfp.xExt = mfp.yExt = 0; /* FIXME ? */
+	hdcScreen = GetDC(NULL);
+	mfp.xExt = MulDiv(width, HIMETRIC_INCHES, GetDeviceCaps(hdcScreen, LOGPIXELSX));
+	mfp.yExt = MulDiv(label_offset + text_size.cy, HIMETRIC_INCHES, GetDeviceCaps(hdcScreen, LOGPIXELSY));
+	ReleaseDC(NULL, hdcScreen);
 	mfp.hMF = CloseMetaFile(hdc);
 	DeleteObject(font);
 	if( !mfp.hMF )




More information about the wine-cvs mailing list