[ttssh2-commit] [10363] 壁紙(背景画像)のファイル名をUnicodeで扱うようにした

Zurück zum Archiv-Index
scmno****@osdn***** scmno****@osdn*****
2022年 11月 14日 (月) 00:11:06 JST


Revision: 10363
          https://osdn.net/projects/ttssh2/scm/svn/commits/10363
Author:   zmatsuo
Date:     2022-11-14 00:11:06 +0900 (Mon, 14 Nov 2022)
Log Message:
-----------
壁紙(背景画像)のファイル名をUnicodeで扱うようにした

- 従来はANSIファイル名で扱っていた
- ファイル名長の上限をなくした
- マニュアルを修正

Modified Paths:
--------------
    trunk/doc/en/html/usage/transparent.html
    trunk/doc/ja/html/usage/transparent.html
    trunk/teraterm/common/win32helper.cpp
    trunk/teraterm/common/win32helper.h
    trunk/teraterm/teraterm/vtdisp.c

-------------- next part --------------
Modified: trunk/doc/en/html/usage/transparent.html
===================================================================
--- trunk/doc/en/html/usage/transparent.html	2022-11-12 14:44:41 UTC (rev 10362)
+++ trunk/doc/en/html/usage/transparent.html	2022-11-13 15:11:06 UTC (rev 10363)
@@ -3,35 +3,36 @@
 <HTML>
 <HEAD>
 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
-<TITLE>look and feel</TITLE>
+<TITLE>look and feel \x82̕ύX</TITLE>
 <META http-equiv="Content-Style-Type" content="text/css">
 <link rel="stylesheet" href="../style.css" type="text/css">
 </HEAD>
 <BODY>
 
-<h1>look and feel\x82̕ύX</h1>
+<h1>look and feel \x82̕ύX</h1>
 
 <p>
-\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x81A\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB5\x82\xC4Tera Term\x82\xCClook and feel\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x82ƃe\x81[\x83}\x82͓\xAF\x8E\x9E\x82ɐݒ肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
+\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x81A\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB5\x82\xC4Tera Term \x82\xCC look and feel\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x82ƃe\x81[\x83}\x82͓\xAF\x8E\x9E\x82ɐݒ肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
 <ul>
-  <li><a href="#transparent">\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</a></li>
-  <li><a href="#theme">\x83e\x81[\x83}</a></li>
+  <li><a href="#transparent">(1) \x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</a></li>
+  <li><a href="#theme">(2) \x83e\x81[\x83}</a></li>
   <ul>
-    <li><a href="#theme/bg">\x83e\x81[\x83}/BG</a></li>
+    <li><a href="#theme/bg">(2)-1 \x83e\x81[\x83}/BG</a></li>
     <ul>
-      <li><a href="#theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</a></li>
-      <li><a href="#theme/bg/image">\x94w\x8Ci\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</a></li>
+      <li><a href="#theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
+      <li><a href="#theme/bg/image">\x94w\x8Ci\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
+      <li><a href="#theme/bg/image+desktop">\x94w\x8Ci\x89摜\x82ƃf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
     </ul>
-    <li><a href="#theme/color">\x83e\x81[\x83}/Color</a></li>
+    <li><a href="#theme/color">(2)-2 \x83e\x81[\x83}/Color</a></li>
   </ul>
 </ul>
 
-<h2 id="transparent">\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</h2>
+<h2 id="transparent">(1) \x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</h2>
 
 <p>
-\x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term\x82̃E\x83B\x83\x93\x83h\x83E\x82𔼓\xA7\x96\xBE\x82ɂ\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81BWindows2000\x88ȍ~\x82ŗL\x8C\xF8\x82ł\xB7\x81B<br>
+\x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term \x82̃E\x83B\x83\x93\x83h\x83E\x82𔼓\xA7\x96\xBE\x82ɂ\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81BWindows2000\x88ȍ~\x82ŗL\x8C\xF8\x82ł\xB7\x81B<br>
 \x90ݒ\xE8\x82́A<a href="../menu/setup-additional-visual.html#AlphaBlendActive">[Setup] Additional settings \x82\xCC Visual \x83^\x83u</a>\x82ōs\x82\xA6\x82܂\xB7\x81B<br>
 \x93\xA7\x96\xBE\x93x\x82\xCD0\x81`255\x82͈̔͂Ŏw\x92肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x81A\x92l\x82\xF0\x8F\xAC\x82\xB3\x82\xAD\x82\xB7\x82\xE9\x82قǓ\xA7\x96\xBE\x93x\x82͋\xAD\x82\xAD\x82Ȃ\xE8\x82܂\xB7\x81B
 \x83f\x83t\x83H\x83\x8B\x83g\x82\xCD255\x81i\x95s\x93\xA7\x96\xBE\x81j\x82ł\xB7\x81B
@@ -44,7 +45,7 @@
 
 <img src="image/screen0.png" width=598 height=488></img>
 
-<h2 id="theme">\x83e\x81[\x83}</h2>
+<h2 id="theme">(2) \x83e\x81[\x83}</h2>
 
 <p>
 Tera Term\x82̔w\x8Ci\x82̉摜\x81A\x95\xB6\x8E\x9A\x82̐F\x82\xF0\x88ꊇ\x82\xB5\x82ĕύX\x82\xB7\x82\xE9\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
@@ -53,31 +54,40 @@
 <a href="../menu/setup-additional-visual.html#theme">[Setup] Additional settings \x82\xCC Visual \x83^\x83u</a>\x82ŁA\x8BN\x93\xAE\x8E\x9E\x82ɓǂݍ\x9E\x82ރe\x81[\x83}\x83t\x83@\x83C\x83\x8B\x82\xF0\x8Ew\x92肵\x82܂\xB7\x81B\x82܂\xBD\x83e\x81[\x83}\x82̐ݒ\xE8\x82́ATheme Editor\x83{\x83^\x83\x93\x82\xF0\x89\x9F\x82\xB7\x82ƕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x90ݒ\xE8\x83_\x83C\x83A\x83\x8D\x83O\x82ōs\x82\xA6\x82܂\xB7\x81B
 </p>
 
-<h3 id="theme/bg">\x83e\x81[\x83}/BG(\x94w\x8Ci)</h3>
+<h3 id="theme/bg">(2)-1 \x83e\x81[\x83}/BG(\x94w\x8Ci)</h3>
 
 <p>
 Tera Term \x82̔w\x8Ci\x82ɁA\x83f\x83X\x83N\x83g\x83b\x83v\x89摜(Windows\x82̔w\x8Ci\x89摜)\x82\xE2\x8Ew\x92\xE8\x89摜\x82\xF0\x95\\x8E\xA6\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82Ǝw\x92\xE8\x89摜\x82\xF0\x83u\x83\x8C\x83\x93\x83h\x82\xB5\x82ĕ\\x8E\xA6\x82\xB7\x82邱\x82Ƃ\xE0\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
-<h4 id="theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</h4>
+<h4 id="theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 <p>
 \x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term\x82̔w\x8Ci\x82Ƀf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82܂\xB7\x81B<br>
 </p>
 
-<img src="image/screen1.png" width=598 height=488></img>
+<img src="image/screen1.png" />
 
 
-<h4 id="theme/bg/image">\x94w\x8Ci\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</h4>
+<h4 id="theme/bg/image">\x94w\x8Ci\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 
 <p>
 \x89摜\x82\xF0\x8Ew\x92肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
-<img src="image/screen3.png" width=598 height=423></img>
+<img src="image/screen3.png" />
 
 
-<h3 id="theme/color">\x83e\x81[\x83}/Color(\x95\xB6\x8E\x9A\x90F)</h3>
+<h4 id="theme/bg/image+desktop">\x94w\x8Ci\x89摜\x82ƃf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 
+<p>
+\x89摜\x83t\x83@\x83C\x83\x8B\x82\xC6Windows \x82̔w\x8Ci\x89摜\x81i\x95ǎ\x86\x81j\x82\xAA\x8D\xAC\x8D\x87\x82\xB5\x82ĕ\\x8E\xA6\x82\xB3\x82\xEA\x82܂\xB7\x81B
+</p>
+
+<img src="image/screen2.png" />
+
+
+<h3 id="theme/color">(2)-2 \x83e\x81[\x83}/Color(\x95\xB6\x8E\x9A\x90F)</h3>
+
 \x95\xB6\x8E\x9A\x82̐F\x82\xF0\x88ꊇ\x82\xB5\x82ĕύX\x82\xB7\x82\xE9\x83J\x83\x89\x81[\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 
 </BODY>

Modified: trunk/doc/ja/html/usage/transparent.html
===================================================================
--- trunk/doc/ja/html/usage/transparent.html	2022-11-12 14:44:41 UTC (rev 10362)
+++ trunk/doc/ja/html/usage/transparent.html	2022-11-13 15:11:06 UTC (rev 10363)
@@ -3,35 +3,36 @@
 <HTML>
 <HEAD>
 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
-<TITLE>look and feel\x82̕ύX</TITLE>
+<TITLE>look and feel \x82̕ύX</TITLE>
 <META http-equiv="Content-Style-Type" content="text/css">
 <link rel="stylesheet" href="../style.css" type="text/css">
 </HEAD>
 <BODY>
 
-<h1>look and feel\x82̕ύX</h1>
+<h1>look and feel \x82̕ύX</h1>
 
 <p>
-\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x81A\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB5\x82\xC4Tera Term\x82\xCClook and feel\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x82ƃe\x81[\x83}\x82͓\xAF\x8E\x9E\x82ɐݒ肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
+\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x81A\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB5\x82\xC4Tera Term \x82\xCC look and feel\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E\x82ƃe\x81[\x83}\x82͓\xAF\x8E\x9E\x82ɐݒ肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
 <ul>
-  <li><a href="#transparent">\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</a></li>
-  <li><a href="#theme">\x83e\x81[\x83}</a></li>
+  <li><a href="#transparent">(1) \x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</a></li>
+  <li><a href="#theme">(2) \x83e\x81[\x83}</a></li>
   <ul>
-    <li><a href="#theme/bg">\x83e\x81[\x83}/BG</a></li>
+    <li><a href="#theme/bg">(2)-1 \x83e\x81[\x83}/BG</a></li>
     <ul>
-      <li><a href="#theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</a></li>
-      <li><a href="#theme/bg/image">\x94w\x8Ci\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</a></li>
+      <li><a href="#theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
+      <li><a href="#theme/bg/image">\x94w\x8Ci\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
+      <li><a href="#theme/bg/image+desktop">\x94w\x8Ci\x89摜\x82ƃf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</a></li>
     </ul>
-    <li><a href="#theme/color">\x83e\x81[\x83}/Color</a></li>
+    <li><a href="#theme/color">(2)-2 \x83e\x81[\x83}/Color</a></li>
   </ul>
 </ul>
 
-<h2 id="transparent">\x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</h2>
+<h2 id="transparent">(1) \x94\xBC\x93\xA7\x96\xBE\x83E\x83B\x83\x93\x83h\x83E</h2>
 
 <p>
-\x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term\x82̃E\x83B\x83\x93\x83h\x83E\x82𔼓\xA7\x96\xBE\x82ɂ\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81BWindows2000\x88ȍ~\x82ŗL\x8C\xF8\x82ł\xB7\x81B<br>
+\x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term \x82̃E\x83B\x83\x93\x83h\x83E\x82𔼓\xA7\x96\xBE\x82ɂ\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81BWindows2000\x88ȍ~\x82ŗL\x8C\xF8\x82ł\xB7\x81B<br>
 \x90ݒ\xE8\x82́A<a href="../menu/setup-additional-visual.html#AlphaBlendActive">[Setup] Additional settings \x82\xCC Visual \x83^\x83u</a>\x82ōs\x82\xA6\x82܂\xB7\x81B<br>
 \x93\xA7\x96\xBE\x93x\x82\xCD0\x81`255\x82͈̔͂Ŏw\x92肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x81A\x92l\x82\xF0\x8F\xAC\x82\xB3\x82\xAD\x82\xB7\x82\xE9\x82قǓ\xA7\x96\xBE\x93x\x82͋\xAD\x82\xAD\x82Ȃ\xE8\x82܂\xB7\x81B
 \x83f\x83t\x83H\x83\x8B\x83g\x82\xCD255\x81i\x95s\x93\xA7\x96\xBE\x81j\x82ł\xB7\x81B
@@ -44,7 +45,7 @@
 
 <img src="image/screen0.png" width=598 height=488></img>
 
-<h2 id="theme">\x83e\x81[\x83}</h2>
+<h2 id="theme">(2) \x83e\x81[\x83}</h2>
 
 <p>
 Tera Term\x82̔w\x8Ci\x82̉摜\x81A\x95\xB6\x8E\x9A\x82̐F\x82\xF0\x88ꊇ\x82\xB5\x82ĕύX\x82\xB7\x82\xE9\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
@@ -53,31 +54,40 @@
 <a href="../menu/setup-additional-visual.html#theme">[Setup] Additional settings \x82\xCC Visual \x83^\x83u</a>\x82ŁA\x8BN\x93\xAE\x8E\x9E\x82ɓǂݍ\x9E\x82ރe\x81[\x83}\x83t\x83@\x83C\x83\x8B\x82\xF0\x8Ew\x92肵\x82܂\xB7\x81B\x82܂\xBD\x83e\x81[\x83}\x82̐ݒ\xE8\x82́ATheme Editor\x83{\x83^\x83\x93\x82\xF0\x89\x9F\x82\xB7\x82ƕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x90ݒ\xE8\x83_\x83C\x83A\x83\x8D\x83O\x82ōs\x82\xA6\x82܂\xB7\x81B
 </p>
 
-<h3 id="theme/bg">\x83e\x81[\x83}/BG(\x94w\x8Ci)</h3>
+<h3 id="theme/bg">(2)-1 \x83e\x81[\x83}/BG(\x94w\x8Ci)</h3>
 
 <p>
 Tera Term \x82̔w\x8Ci\x82ɁA\x83f\x83X\x83N\x83g\x83b\x83v\x89摜(Windows\x82̔w\x8Ci\x89摜)\x82\xE2\x8Ew\x92\xE8\x89摜\x82\xF0\x95\\x8E\xA6\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82Ǝw\x92\xE8\x89摜\x82\xF0\x83u\x83\x8C\x83\x93\x83h\x82\xB5\x82ĕ\\x8E\xA6\x82\xB7\x82邱\x82Ƃ\xE0\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
-<h4 id="theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</h4>
+<h4 id="theme/bg/desktop">\x83f\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 <p>
 \x82\xB1\x82̋@\x94\\x82\xF0\x8Eg\x82\xA4\x82ƁATera Term\x82̔w\x8Ci\x82Ƀf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82܂\xB7\x81B<br>
 </p>
 
-<img src="image/screen1.png" width=598 height=488></img>
+<img src="image/screen1.png" />
 
 
-<h4 id="theme/bg/image">\x94w\x8Ci\x89摜\x82̓\\x82\xE8\x95t\x82\xAF</h4>
+<h4 id="theme/bg/image">\x94w\x8Ci\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 
 <p>
 \x89摜\x82\xF0\x8Ew\x92肷\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 </p>
 
-<img src="image/screen3.png" width=598 height=423></img>
+<img src="image/screen3.png" />
 
 
-<h3 id="theme/color">\x83e\x81[\x83}/Color(\x95\xB6\x8E\x9A\x90F)</h3>
+<h4 id="theme/bg/image+desktop">\x94w\x8Ci\x89摜\x82ƃf\x83X\x83N\x83g\x83b\x83v\x89摜\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9</h4>
 
+<p>
+\x89摜\x83t\x83@\x83C\x83\x8B\x82\xC6Windows \x82̔w\x8Ci\x89摜\x81i\x95ǎ\x86\x81j\x82\xAA\x8D\xAC\x8D\x87\x82\xB5\x82ĕ\\x8E\xA6\x82\xB3\x82\xEA\x82܂\xB7\x81B
+</p>
+
+<img src="image/screen2.png" />
+
+
+<h3 id="theme/color">(2)-2 \x83e\x81[\x83}/Color(\x95\xB6\x8E\x9A\x90F)</h3>
+
 \x95\xB6\x8E\x9A\x82̐F\x82\xF0\x88ꊇ\x82\xB5\x82ĕύX\x82\xB7\x82\xE9\x83J\x83\x89\x81[\x83e\x81[\x83}\x82\xF0\x8Eg\x97p\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B
 
 </BODY>

Modified: trunk/teraterm/common/win32helper.cpp
===================================================================
--- trunk/teraterm/common/win32helper.cpp	2022-11-12 14:44:41 UTC (rev 10362)
+++ trunk/teraterm/common/win32helper.cpp	2022-11-13 15:11:06 UTC (rev 10363)
@@ -278,3 +278,33 @@
 	*expanded = dest;
 	return NO_ERROR;
 }
+
+/**
+ *	RegQueryValueExW \x82̓\xAE\x93I\x83o\x83b\x83t\x83@\x94\xC5
+ *
+ *	lpData \x82\xAA malloc() \x82\xF0\x8Eg\x82\xC1\x82Ċm\x95ۂ\xB3\x82\xEA\x82\xE9
+ *	\x95s\x97v\x82ɂȂ\xC1\x82\xBD\x82\xE7 free() \x82\xB7\x82邱\x82\xC6
+ */
+LSTATUS hRegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, void **lpData,
+						  LPDWORD lpcbData)
+{
+	DWORD len;
+	LSTATUS r = RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, NULL, &len);
+	if (r != ERROR_SUCCESS) {
+		*lpData = NULL;
+		goto finish;
+	}
+	void *p = malloc(len);
+	r = RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, p, &len);
+	if (r != ERROR_SUCCESS) {
+		free(p);
+		*lpData = NULL;
+		goto finish;
+	}
+	*lpData = p;
+finish:
+	if (lpcbData != NULL) {
+		*lpcbData = len;
+	}
+	return r;
+}

Modified: trunk/teraterm/common/win32helper.h
===================================================================
--- trunk/teraterm/common/win32helper.h	2022-11-12 14:44:41 UTC (rev 10362)
+++ trunk/teraterm/common/win32helper.h	2022-11-13 15:11:06 UTC (rev 10363)
@@ -41,6 +41,8 @@
 DWORD hGetWindowTextW(HWND hWnd, wchar_t **text);
 DWORD hGetDlgItemTextW(HWND hDlg, int id, wchar_t **text);
 DWORD hExpandEnvironmentStringsW(const wchar_t *src, wchar_t **expanded);
+LSTATUS hRegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, void **lpData,
+						  LPDWORD lpcbData);
 
 #ifdef __cplusplus
 }

Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2022-11-12 14:44:41 UTC (rev 10362)
+++ trunk/teraterm/teraterm/vtdisp.c	2022-11-13 15:11:06 UTC (rev 10363)
@@ -160,9 +160,9 @@
 
 typedef struct tagWallpaperInfo
 {
-  char filename[MAX_PATH];
-  int  pattern;
-}WallpaperInfo;
+	wchar_t *filename;
+	int  pattern;
+} WallpaperInfo;
 
 static BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
 
@@ -178,7 +178,6 @@
 } vtdisp_work_t;
 static vtdisp_work_t vtdisp_work;
 
-static HBITMAP GetBitmapHandle(const char *File);
 static HBITMAP GetBitmapHandleW(const wchar_t *File);
 static void InitColorTable(const COLORREF *ANSIColor16);
 static void UpdateBGBrush(void);
@@ -492,59 +491,64 @@
 
 static void BGGetWallpaperInfo(WallpaperInfo *wi)
 {
-  DWORD length;
-  int style;
-  int  tile;
-  char str[256];
-  HKEY hKey;
+	DWORD length;
+	int style;
+	int  tile;
+	char str[256];
+	HKEY hKey;
 
-  wi->pattern = BG_CENTER;
-  strncpy_s(wi->filename, sizeof(wi->filename),"", _TRUNCATE);
+	wi->pattern = BG_CENTER;
+	wi->filename = NULL;
 
-  //\x83\x8C\x83W\x83X\x83g\x83\x8A\x83L\x81[\x82̃I\x81[\x83v\x83\x93
-  if(RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
-    return;
+	//\x83\x8C\x83W\x83X\x83g\x83\x8A\x83L\x81[\x82̃I\x81[\x83v\x83\x93
+	if(RegOpenKeyExA(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
+		return;
 
-  //\x95ǎ\x86\x96\xBC\x83Q\x83b\x83g
-  length = MAX_PATH;
-  RegQueryValueEx(hKey,"Wallpaper"     ,NULL,NULL,(BYTE*)(wi->filename),&length);
+	//\x95ǎ\x86\x83t\x83@\x83C\x83\x8B\x96\xBC\x83Q\x83b\x83g
+	hRegQueryValueExW(hKey, L"Wallpaper", NULL, NULL, &wi->filename, NULL);
 
-  //\x95ǎ\x86\x83X\x83^\x83C\x83\x8B\x83Q\x83b\x83g
-  length = 256;
-  RegQueryValueEx(hKey,"WallpaperStyle",NULL,NULL,(BYTE*)str,&length);
-  style = atoi(str);
+	//\x95ǎ\x86\x83X\x83^\x83C\x83\x8B\x83Q\x83b\x83g
+	length = sizeof(str);
+	RegQueryValueExA(hKey,"WallpaperStyle",NULL,NULL,(BYTE*)str,&length);
+	style = atoi(str);
 
-  //\x95ǎ\x86\x83X\x83^\x83C\x83\x8B\x83Q\x83b\x83g
-  length = 256;
-  RegQueryValueEx(hKey,"TileWallpaper" ,NULL,NULL,(BYTE*)str,&length);
-  tile = atoi(str);
+	//\x95ǎ\x86\x83X\x83^\x83C\x83\x8B\x83Q\x83b\x83g
+	length = sizeof(str);
+	RegQueryValueExA(hKey,"TileWallpaper" ,NULL,NULL,(BYTE*)str,&length);
+	tile = atoi(str);
 
-  //\x82\xB1\x82\xEA\x82ł\xA2\x82\xA2\x82́H
-  if(tile)
-    wi->pattern = BG_TILE;
-  else {
-    switch (style) {
-    case 0: // Center(\x92\x86\x89\x9B\x82ɕ\\x8E\xA6)
-      wi->pattern = BG_CENTER;
-      break;
-    case 2: // Stretch(\x89\xE6\x96ʂɍ\x87\x82킹\x82ĐL\x8Fk) \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82͖\xB3\x8E\x8B\x82\xB3\x82\xEA\x82\xE9
-      wi->pattern = BG_STRETCH;
-      break;
-    case 10: // Fill(\x83y\x81[\x83W\x89\xA1\x95\x9D\x82ɍ\x87\x82킹\x82\xE9) \x82Ƃ\xA0\x82邪\x81A\x98a\x96󂪂\xA8\x82\xA9\x82\xB5\x82\xA2
-             // \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82\xF0\x88ێ\x9D\x82\xB5\x82āA\x82͂ݏo\x82\xB5\x82Ăł\xE0\x8Dő\xE5\x95\\x8E\xA6\x82\xB7\x82\xE9
-      wi->pattern = BG_AUTOFILL;
-      break;
-    case 6: // Fit(\x83y\x81[\x83W\x8Fc\x95\x9D\x82ɍ\x87\x82킹\x82\xE9) \x82Ƃ\xA0\x82邪\x81A\x98a\x96󂪂\xA8\x82\xA9\x82\xB5\x82\xA2
-      // \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82\xF0\x88ێ\x9D\x82\xB5\x82āA\x82͂ݏo\x82\xB3\x82Ȃ\xA2\x82悤\x82ɍő\xE5\x95\\x8E\xA6\x82\xB7\x82\xE9
-      wi->pattern = BG_AUTOFIT;
-      break;
-    }
-  }
+	//\x83\x8C\x83W\x83X\x83g\x83\x8A\x83L\x81[\x82̃N\x83\x8D\x81[\x83Y
+	RegCloseKey(hKey);
 
-  //\x83\x8C\x83W\x83X\x83g\x83\x8A\x83L\x81[\x82̃N\x83\x8D\x81[\x83Y
-  RegCloseKey(hKey);
+	//\x82\xB1\x82\xEA\x82ł\xA2\x82\xA2\x82́H
+	if(tile)
+		wi->pattern = BG_TILE;
+	else {
+		switch (style) {
+		case 0: // Center(\x92\x86\x89\x9B\x82ɕ\\x8E\xA6)
+			wi->pattern = BG_CENTER;
+			break;
+		case 2: // Stretch(\x89\xE6\x96ʂɍ\x87\x82킹\x82ĐL\x8Fk) \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82͖\xB3\x8E\x8B\x82\xB3\x82\xEA\x82\xE9
+			wi->pattern = BG_STRETCH;
+			break;
+		case 10: // Fill(\x83y\x81[\x83W\x89\xA1\x95\x9D\x82ɍ\x87\x82킹\x82\xE9) \x82Ƃ\xA0\x82邪\x81A\x98a\x96󂪂\xA8\x82\xA9\x82\xB5\x82\xA2
+			// \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82\xF0\x88ێ\x9D\x82\xB5\x82āA\x82͂ݏo\x82\xB5\x82Ăł\xE0\x8Dő\xE5\x95\\x8E\xA6\x82\xB7\x82\xE9
+			wi->pattern = BG_AUTOFILL;
+			break;
+		case 6: // Fit(\x83y\x81[\x83W\x8Fc\x95\x9D\x82ɍ\x87\x82킹\x82\xE9) \x82Ƃ\xA0\x82邪\x81A\x98a\x96󂪂\xA8\x82\xA9\x82\xB5\x82\xA2
+			// \x83A\x83X\x83y\x83N\x83g\x94\xE4\x82\xF0\x88ێ\x9D\x82\xB5\x82āA\x82͂ݏo\x82\xB3\x82Ȃ\xA2\x82悤\x82ɍő\xE5\x95\\x8E\xA6\x82\xB7\x82\xE9
+			wi->pattern = BG_AUTOFIT;
+			break;
+		}
+	}
 }
 
+/**
+ *	OleLoadPicture() \x82\xF0\x8Eg\x82\xC1\x82\xBD\x89摜\x93ǂݍ\x9E\x82\xDD
+ * 	jpeg, bmp \x82\xF0\x93ǂݍ\x9E\x82ނ\xB1\x82Ƃ\xAA\x82ł\xAB\x82\xE9
+ *	(Windows\x82ɂ\xE6\x82\xC1\x82Ă͑\xBC\x82̌`\x8E\xAE\x82\xE0\x93ǂ߂邩\x82\xE0\x82\xB5\x82\xEA\x82Ȃ\xA2)
+ *
+ */
 // .bmp\x88ȊO\x82̉摜\x83t\x83@\x83C\x83\x8B\x82\xF0\x93ǂށB
 // \x95ǎ\x86\x82\xAA .bmp \x88ȊO\x82̃t\x83@\x83C\x83\x8B\x82ɂȂ\xC1\x82Ă\xA2\x82\xBD\x8Fꍇ\x82ւ̑Ώ\x88\x81B
 // \x82\xB1\x82̊֐\x94\x82\xCD Windows 2000 \x96\xA2\x96\x9E\x82̏ꍇ\x82ɂ͌Ă\xF1\x82ł͂\xA2\x82\xAF\x82Ȃ\xA2
@@ -725,10 +729,10 @@
 		//\x95ǎ\x86\x82\xF0\x93ǂݍ\x9E\x82\xDD
 		//LR_CREATEDIBSECTION \x82\xF0\x8Ew\x92肷\x82\xE9\x82̂\xAA\x83R\x83c
 		if (wi.pattern == BG_STRETCH) {
-			hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,CRTWidth,CRTHeight,LR_LOADFROMFILE | LR_CREATEDIBSECTION);
+			hbm = LoadImageW(0, wi.filename, IMAGE_BITMAP, CRTWidth, CRTHeight, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
 		}
 		else {
-			hbm = LoadImage(0,wi.filename,IMAGE_BITMAP,        0,       0,LR_LOADFROMFILE);
+			hbm = LoadImageW(0, wi.filename, IMAGE_BITMAP,         0,        0, LR_LOADFROMFILE);
 		}
 	}
 	else {
@@ -735,9 +739,9 @@
 		BITMAP bm;
 		float ratio;
 
-		hbm = GetBitmapHandle(wi.filename);
+		hbm = GetBitmapHandleW(wi.filename);
 		if (hbm == NULL) {
-			goto createdc;
+			goto load_finish;
 		}
 
 		GetObject(hbm,sizeof(bm),&bm);
@@ -786,9 +790,10 @@
 			wi.pattern = BG_STRETCH;
 		}
 	}
+load_finish:
+	free(wi.filename);
 
 	//\x95ǎ\x86DC\x82\xF0\x8D\xEC\x82\xE9
-createdc:
 	if(hbm)
 	{
 		BITMAP bm;


ttssh2-commit メーリングリストの案内
Zurück zum Archiv-Index