[Ttssh2-commit] [4571] Vista 未満の場合には、今まで通りの読み込みをするようにした

svnno****@sourc***** svnno****@sourc*****
2011年 8月 4日 (木) 15:43:47 JST


Revision: 4571
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4571
Author:   maya
Date:     2011-08-04 15:43:46 +0900 (Thu, 04 Aug 2011)

Log Message:
-----------
Vista 未満の場合には、今まで通りの読み込みをするようにした

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtdisp.c


-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2011-08-04 06:40:46 UTC (rev 4570)
+++ trunk/teraterm/teraterm/vtdisp.c	2011-08-04 06:43:46 UTC (rev 4571)
@@ -15,7 +15,7 @@
 #include "vtdisp.h"
 
 #include <locale.h>
-#include<olectl.h>
+#include <olectl.h>
 
 #define CurWidth 2
 
@@ -641,8 +641,9 @@
 // •ÇŽ†‚ª .bmp ˆÈŠO‚̃tƒ@ƒCƒ‹‚É‚È‚Á‚Ä‚¢‚½ê‡‚ւ̑ΏˆB
 // (2011.8.3 yutaka)
 // cf. http://www.geocities.jp/ccfjd821/purogu/wpe-ji9.html
+// ‚±‚̊֐”‚Í Windows 2000 –¢–ž‚̏ꍇ‚ɂ͌Ăñ‚Å‚Í‚¢‚¯‚È‚¢
 static HBITMAP GetBitmapHandle(char *File)
-{  
+{
 	OLE_HANDLE hOle = 0;
 	IStream *iStream=NULL;
 	IPicture *iPicture;
@@ -683,18 +684,32 @@
 {
   HBITMAP       hbm;
   WallpaperInfo wi;
+  OSVERSIONINFO osvi;
 
   BGGetWallpaperInfo(&wi);
 
   //•ÇŽ†‚ð“ǂݍž‚Ý
   //LR_CREATEDIBSECTION ‚ðŽw’è‚·‚é‚Ì‚ªƒRƒc
-  if (wi.pattern == BG_STRETCH) {
-    hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,CRTWidth,CRTHeight,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
-	// TODO: ‰æ‘œ‚ð‰æ–Ê‚¢‚Á‚Ï‚¢‚ÉŠg‘å‚·‚é‚ɂ́A‚Ç‚¤‚µ‚½‚ç‚æ‚¢‚©H
-  } else {
-    //hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,        0,       0,LR_LOADFROMFILE);
-	hbm = GetBitmapHandle(wi.filename);
+  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+  GetVersionEx(&osvi);
+  if (osvi.dwMajorVersion < 6) {
+    if (wi.pattern == BG_STRETCH) {
+      hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,CRTWidth,CRTHeight,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
+    }
+    else {
+      hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,        0,       0,LR_LOADFROMFILE);
+    }
   }
+  else {
+    if (wi.pattern == BG_STRETCH) {
+      hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,CRTWidth,CRTHeight,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
+      // TODO: ‰æ‘œ‚ð‰æ–Ê‚¢‚Á‚Ï‚¢‚ÉŠg‘å‚·‚é‚ɂ́A‚Ç‚¤‚µ‚½‚ç‚æ‚¢‚©H
+    }
+    else {
+      //hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,        0,       0,LR_LOADFROMFILE);
+      hbm = GetBitmapHandle(wi.filename);
+    }
+  }
 
   //•ÇŽ†DC‚ðì‚é
   if(hbm)



Ttssh2-commit メーリングリストの案内