Revision: 10353 https://osdn.net/projects/ttssh2/scm/svn/commits/10353 Author: zmatsuo Date: 2022-11-07 00:35:13 +0900 (Mon, 07 Nov 2022) Log Message: ----------- 背景画像読み込み時、OLE画像ファイル読み込みをUnicodeファイル名で行うようにした - GetBitmapHandle() の Unicode版 GetBitmapHandleW() を追加 - 他の箇所はそのまま Modified Paths: -------------- trunk/teraterm/teraterm/vtdisp.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2022-11-06 15:35:05 UTC (rev 10352) +++ trunk/teraterm/teraterm/vtdisp.c 2022-11-06 15:35:13 UTC (rev 10353) @@ -179,6 +179,7 @@ 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); static void GetDrawAttr(const TCharAttr *Attr, BOOL _reverse, COLORREF *fore_color, COLORREF *back_color, BYTE *_alpha); @@ -463,9 +464,7 @@ // OLE \x82𗘗p\x82\xB5\x82ĉ摜(jpeg)\x82\xF0\x93ǂ\xDE // LoadImage()\x82̂\x96\x89\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x8A\xAB\x82ł͂Ȃ\xA2\x82Ƃ\xAB if (hbm == NULL && !IsLoadImageOnlyEnabled()) { - char *load_fileA = ToCharW(load_file); - hbm = GetBitmapHandle(load_fileA); - free(load_fileA); + hbm = GetBitmapHandleW(load_file); } // LoadImageW() API \x82œǂݍ\x9E\x82\xDE @@ -552,7 +551,7 @@ // TODO: // IsLoadImageOnlyEnabled() \x82\xCD Vista \x96\xA2\x96\x9E\x82ƂȂ\xC1\x82Ă\xA2\x82\xE9 // -static HBITMAP GetBitmapHandle(const char *File) +static HBITMAP GetBitmapHandleW(const wchar_t *File) { OLE_HANDLE hOle = 0; IStream *iStream=NULL; @@ -565,7 +564,7 @@ HBITMAP hBitmap = NULL; HRESULT result; - hFile=CreateFile(File,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); + hFile=CreateFileW(File,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); if (hFile == INVALID_HANDLE_VALUE) { return NULL; } @@ -598,6 +597,15 @@ return hBitmap; } +static HBITMAP GetBitmapHandle(const char *File) +{ + HBITMAP hBmp; + wchar_t *FileW = ToWcharA(File); + hBmp = GetBitmapHandleW(FileW); + free(FileW); + return hBmp; +} + // \x90\xFC\x8C`\x95⊮\x96@\x82ɂ\xE6\x82\xE8\x94\xE4\x8Ar\x93I\x91N\x96\xBE\x82Ƀr\x83b\x83g\x83}\x83b\x83v\x82\xF0\x8Ag\x91\xE5\x81E\x8Fk\x8F\xAC\x82\xB7\x82\xE9\x81B // Windows 9x/NT\x91Ή\x9E // cf.http://katahiromz.web.fc2.com/win32/bilinear.html