| 144 |
|
|
| 145 |
va_start(args,format); |
va_start(args,format); |
| 146 |
|
|
| 147 |
vsprintf(buffer,format,args); |
_vsnprintf_s(buffer,sizeof(buffer),_TRUNCATE,format,args); |
| 148 |
strcat(buffer,"\n"); |
strncat_s(buffer,sizeof(buffer),"\n",_TRUNCATE); |
| 149 |
|
|
| 150 |
OutputDebugString(buffer); |
OutputDebugString(buffer); |
| 151 |
} |
} |
| 281 |
return 0; |
return 0; |
| 282 |
} |
} |
| 283 |
|
|
| 284 |
void RandomFile(char *filespec,char *filename) |
void RandomFile(char *filespec,char *filename, int destlen) |
| 285 |
{ |
{ |
| 286 |
int i; |
int i; |
| 287 |
int file_num; |
int file_num; |
| 291 |
HANDLE hFind; |
HANDLE hFind; |
| 292 |
WIN32_FIND_DATA fd; |
WIN32_FIND_DATA fd; |
| 293 |
|
|
|
strcpy(filename,""); |
|
|
|
|
| 294 |
//絶対パスに変換 |
//絶対パスに変換 |
| 295 |
if(!GetFullPathName(filespec,MAX_PATH,fullpath,&filePart)) |
if(!GetFullPathName(filespec,MAX_PATH,fullpath,&filePart)) |
| 296 |
return; |
return; |
| 340 |
FindClose(hFind); |
FindClose(hFind); |
| 341 |
|
|
| 342 |
//ディレクトリ取得 |
//ディレクトリ取得 |
| 343 |
ZeroMemory(filename,MAX_PATH); |
ZeroMemory(filename,destlen); |
| 344 |
strncpy(filename,fullpath,filePart - fullpath); |
{ |
| 345 |
strcat(filename,fd.cFileName); |
int tmplen; |
| 346 |
|
char *tmp; |
| 347 |
|
tmplen = filePart - fullpath + 1; |
| 348 |
|
tmp = (char *)_alloca(tmplen); |
| 349 |
|
strncpy_s(tmp,tmplen,fullpath,filePart - fullpath); |
| 350 |
|
strncpy_s(filename,destlen,tmp,_TRUNCATE); |
| 351 |
|
} |
| 352 |
|
strncat_s(filename,destlen,fd.cFileName,_TRUNCATE); |
| 353 |
} |
} |
| 354 |
|
|
| 355 |
BOOL LoadPictureWithSPI(char *nameSPI,char *nameFile,unsigned char *bufFile,long sizeFile,HLOCAL *hbuf,HLOCAL *hbmi) |
BOOL LoadPictureWithSPI(char *nameSPI,char *nameFile,unsigned char *bufFile,long sizeFile,HLOCAL *hbuf,HLOCAL *hbmi) |
| 528 |
if(hFind != INVALID_HANDLE_VALUE && filePart) |
if(hFind != INVALID_HANDLE_VALUE && filePart) |
| 529 |
{ |
{ |
| 530 |
//ディレクトリ取得 |
//ディレクトリ取得 |
| 531 |
ZeroMemory(spiPath,MAX_PATH); |
ExtractDirName(filespec, spiPath); |
| 532 |
strncpy(spiPath,filespec,filePart - filespec); |
AppendSlash(spiPath, sizeof(spiPath)); |
| 533 |
|
|
| 534 |
do{ |
do{ |
| 535 |
HLOCAL hbuf,hbmi; |
HLOCAL hbuf,hbmi; |
| 540 |
if(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) |
if(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) |
| 541 |
continue; |
continue; |
| 542 |
|
|
| 543 |
strcpy(spiFileName,spiPath); |
strncpy_s(spiFileName, sizeof(spiFileName), spiPath, _TRUNCATE); |
| 544 |
strcat(spiFileName,fd.cFileName); |
strncat_s(spiFileName, sizeof(spiFileName), fd.cFileName, _TRUNCATE); |
| 545 |
|
|
| 546 |
if(LoadPictureWithSPI(spiFileName,src->file,fileBuf,fileSize,&hbuf,&hbmi)) |
if(LoadPictureWithSPI(spiFileName,src->file,fileBuf,fileSize,&hbuf,&hbmi)) |
| 547 |
{ |
{ |
| 556 |
LocalFree(hbmi); |
LocalFree(hbmi); |
| 557 |
LocalFree(hbuf); |
LocalFree(hbuf); |
| 558 |
|
|
| 559 |
strcpy(src->file,src->fileTmp); |
strncpy_s(src->file, sizeof(src->file),src->fileTmp, _TRUNCATE); |
| 560 |
|
|
| 561 |
break; |
break; |
| 562 |
} |
} |
| 593 |
HKEY hKey; |
HKEY hKey; |
| 594 |
|
|
| 595 |
wi->pattern = BG_CENTER; |
wi->pattern = BG_CENTER; |
| 596 |
strcpy(wi->filename,""); |
strncpy_s(wi->filename, sizeof(wi->filename),"", _TRUNCATE); |
| 597 |
|
|
| 598 |
//レジストリキーのオープン |
//レジストリキーのオープン |
| 599 |
if(RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &hKey) != ERROR_SUCCESS) |
if(RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_READ, &hKey) != ERROR_SUCCESS) |
| 967 |
unsigned int r,g,b; |
unsigned int r,g,b; |
| 968 |
char colorstr[256],defstr[256]; |
char colorstr[256],defstr[256]; |
| 969 |
|
|
| 970 |
sprintf(defstr,"%d,%d,%d",GetRValue(defcolor),GetGValue(defcolor),GetBValue(defcolor)); |
_snprintf_s(defstr,sizeof(defstr),_TRUNCATE,"%d,%d,%d",GetRValue(defcolor),GetGValue(defcolor),GetBValue(defcolor)); |
| 971 |
|
|
| 972 |
GetPrivateProfileString(BG_SECTION,name,defstr,colorstr,255,file); |
GetPrivateProfileString(BG_SECTION,name,defstr,colorstr,255,file); |
| 973 |
|
|
| 985 |
|
|
| 986 |
def %= nList; |
def %= nList; |
| 987 |
|
|
| 988 |
strcpy(defstr,strList[def]); |
strncpy_s(defstr, sizeof(defstr),strList[def], _TRUNCATE); |
| 989 |
GetPrivateProfileString(BG_SECTION,name,defstr,str,64,file); |
GetPrivateProfileString(BG_SECTION,name,defstr,str,64,file); |
| 990 |
|
|
| 991 |
for(i = 0;i < nList;i++) |
for(i = 0;i < nList;i++) |
| 1060 |
BGDest.color = BGGetColor("BGPictureBaseColor",BGSrc1.color,file); |
BGDest.color = BGGetColor("BGPictureBaseColor",BGSrc1.color,file); |
| 1061 |
|
|
| 1062 |
GetPrivateProfileString(BG_SECTION,"BGPictureFile",BGSrc1.file,path,MAX_PATH,file); |
GetPrivateProfileString(BG_SECTION,"BGPictureFile",BGSrc1.file,path,MAX_PATH,file); |
| 1063 |
RandomFile(path,BGDest.file); |
RandomFile(path,BGDest.file,sizeof(BGDest.file)); |
| 1064 |
|
|
| 1065 |
BGSrc1.alpha = 255 - GetPrivateProfileInt(BG_SECTION,"BGPictureTone",255 - BGSrc1.alpha,file); |
BGSrc1.alpha = 255 - GetPrivateProfileInt(BG_SECTION,"BGPictureTone",255 - BGSrc1.alpha,file); |
| 1066 |
|
|
| 1080 |
BGSrc1.color = BGGetColor("BGSrc1Color",BGSrc1.color,file); |
BGSrc1.color = BGGetColor("BGSrc1Color",BGSrc1.color,file); |
| 1081 |
|
|
| 1082 |
GetPrivateProfileString(BG_SECTION,"BGSrc1File",BGSrc1.file,path,MAX_PATH,file); |
GetPrivateProfileString(BG_SECTION,"BGSrc1File",BGSrc1.file,path,MAX_PATH,file); |
| 1083 |
RandomFile(path,BGSrc1.file); |
RandomFile(path,BGSrc1.file,sizeof(BGSrc1.file)); |
| 1084 |
|
|
| 1085 |
//Src2 の読み出し |
//Src2 の読み出し |
| 1086 |
BGSrc2.type = BGGetType("BGSrc2Type",BGSrc2.type,file); |
BGSrc2.type = BGGetType("BGSrc2Type",BGSrc2.type,file); |
| 1090 |
BGSrc2.color = BGGetColor("BGSrc2Color",BGSrc2.color,file); |
BGSrc2.color = BGGetColor("BGSrc2Color",BGSrc2.color,file); |
| 1091 |
|
|
| 1092 |
GetPrivateProfileString(BG_SECTION,"BGSrc2File",BGSrc2.file,path,MAX_PATH,file); |
GetPrivateProfileString(BG_SECTION,"BGSrc2File",BGSrc2.file,path,MAX_PATH,file); |
| 1093 |
RandomFile(path,BGSrc2.file); |
RandomFile(path,BGSrc2.file,sizeof(BGSrc2.file)); |
| 1094 |
|
|
| 1095 |
//Dest の読み出し |
//Dest の読み出し |
| 1096 |
BGDest.type = BGGetType("BGDestType",BGDest.type,file); |
BGDest.type = BGGetType("BGDestType",BGDest.type,file); |
| 1099 |
BGDest.color = BGGetColor("BGDestColor",BGDest.color,file); |
BGDest.color = BGGetColor("BGDestColor",BGDest.color,file); |
| 1100 |
|
|
| 1101 |
GetPrivateProfileString(BG_SECTION,"BGDestFile",BGDest.file,path,MAX_PATH,file); |
GetPrivateProfileString(BG_SECTION,"BGDestFile",BGDest.file,path,MAX_PATH,file); |
| 1102 |
RandomFile(path,BGDest.file); |
RandomFile(path,BGDest.file,sizeof(BGDest.file)); |
| 1103 |
|
|
| 1104 |
//その他読み出し |
//その他読み出し |
| 1105 |
BGReverseTextAlpha = GetPrivateProfileInt(BG_SECTION,"BGReverseTextAlpha",BGReverseTextAlpha,file); |
BGReverseTextAlpha = GetPrivateProfileInt(BG_SECTION,"BGReverseTextAlpha",BGReverseTextAlpha,file); |
| 1189 |
ts.EtermLookfeel.BGNoCopyBits = BGGetOnOff("BGFlickerlessMove" ,TRUE ,ts.SetupFName); |
ts.EtermLookfeel.BGNoCopyBits = BGGetOnOff("BGFlickerlessMove" ,TRUE ,ts.SetupFName); |
| 1190 |
|
|
| 1191 |
GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName); |
GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName); |
| 1192 |
strcpy(ts.EtermLookfeel.BGSPIPath, BGSPIPath); |
strncpy_s(ts.EtermLookfeel.BGSPIPath, sizeof(ts.EtermLookfeel.BGSPIPath), BGSPIPath, _TRUNCATE); |
| 1193 |
|
|
| 1194 |
//コンフィグファイルの決定 |
//コンフィグファイルの決定 |
| 1195 |
GetPrivateProfileString(BG_SECTION,"BGThemeFile","",path,MAX_PATH,ts.SetupFName); |
GetPrivateProfileString(BG_SECTION,"BGThemeFile","",path,MAX_PATH,ts.SetupFName); |
| 1196 |
strcpy(ts.EtermLookfeel.BGThemeFile, path); |
strncpy_s(ts.EtermLookfeel.BGThemeFile, sizeof(ts.EtermLookfeel.BGThemeFile), path, _TRUNCATE); |
| 1197 |
|
|
| 1198 |
if(!BGEnable) |
if(!BGEnable) |
| 1199 |
return; |
return; |
| 1210 |
|
|
| 1211 |
#if 0 |
#if 0 |
| 1212 |
GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName); |
GetPrivateProfileString(BG_SECTION,"BGSPIPath","plugin",BGSPIPath,MAX_PATH,ts.SetupFName); |
| 1213 |
strcpy(ts.EtermLookfeel.BGSPIPath, BGSPIPath); |
strncpy_s(ts.EtermLookfeel.BGSPIPath, sizeof(ts.EtermLookfeel.BGSPIPath), BGSPIPath, _TRUNCATE); |
| 1214 |
#endif |
#endif |
| 1215 |
|
|
| 1216 |
//テンポラリーファイル名を生成 |
//テンポラリーファイル名を生成 |
| 1224 |
BGDest.pattern = BG_STRETCH; |
BGDest.pattern = BG_STRETCH; |
| 1225 |
BGDest.color = RGB(0,0,0); |
BGDest.color = RGB(0,0,0); |
| 1226 |
BGDest.antiAlias = TRUE; |
BGDest.antiAlias = TRUE; |
| 1227 |
strcpy(BGDest.file,""); |
strncpy_s(BGDest.file, sizeof(BGDest.file),"", _TRUNCATE); |
| 1228 |
|
|
| 1229 |
BGSrc1.type = BG_WALLPAPER; |
BGSrc1.type = BG_WALLPAPER; |
| 1230 |
BGSrc1.pattern = BG_STRETCH; |
BGSrc1.pattern = BG_STRETCH; |
| 1231 |
BGSrc1.color = RGB(255,255,255); |
BGSrc1.color = RGB(255,255,255); |
| 1232 |
BGSrc1.antiAlias = TRUE; |
BGSrc1.antiAlias = TRUE; |
| 1233 |
BGSrc1.alpha = 255; |
BGSrc1.alpha = 255; |
| 1234 |
strcpy(BGSrc1.file,""); |
strncpy_s(BGSrc1.file, sizeof(BGSrc1.file),"", _TRUNCATE); |
| 1235 |
|
|
| 1236 |
BGSrc2.type = BG_COLOR; |
BGSrc2.type = BG_COLOR; |
| 1237 |
BGSrc2.pattern = BG_STRETCH; |
BGSrc2.pattern = BG_STRETCH; |
| 1238 |
BGSrc2.color = RGB(0,0,0); |
BGSrc2.color = RGB(0,0,0); |
| 1239 |
BGSrc2.antiAlias = TRUE; |
BGSrc2.antiAlias = TRUE; |
| 1240 |
BGSrc2.alpha = 128; |
BGSrc2.alpha = 128; |
| 1241 |
strcpy(BGSrc2.file,""); |
strncpy_s(BGSrc2.file, sizeof(BGSrc2.file),"", _TRUNCATE); |
| 1242 |
|
|
| 1243 |
BGReverseTextAlpha = 255; |
BGReverseTextAlpha = 255; |
| 1244 |
|
|
| 1247 |
|
|
| 1248 |
//コンフィグファイルの決定 |
//コンフィグファイルの決定 |
| 1249 |
GetPrivateProfileString(BG_SECTION,"BGThemeFile","",path,MAX_PATH,ts.SetupFName); |
GetPrivateProfileString(BG_SECTION,"BGThemeFile","",path,MAX_PATH,ts.SetupFName); |
| 1250 |
RandomFile(path,config_file); |
RandomFile(path,config_file,sizeof(config_file)); |
| 1251 |
|
|
| 1252 |
//設定のオーバーライド |
//設定のオーバーライド |
| 1253 |
if(strcmp(config_file,"")) |
if(strcmp(config_file,"")) |
| 1266 |
} |
} |
| 1267 |
|
|
| 1268 |
//SPI のパスを整形 |
//SPI のパスを整形 |
| 1269 |
AppendSlash(BGSPIPath); |
AppendSlash(BGSPIPath,sizeof(BGSPIPath)); |
| 1270 |
strcat(BGSPIPath,"*"); |
strncat_s(BGSPIPath,sizeof(BGSPIPath),"*",_TRUNCATE); |
| 1271 |
|
|
| 1272 |
//壁紙 or 背景をプリロード |
//壁紙 or 背景をプリロード |
| 1273 |
BGPreloadSrc(&BGDest); |
BGPreloadSrc(&BGDest); |
| 1565 |
VTlf.lfClipPrecision = CLIP_CHARACTER_PRECIS; |
VTlf.lfClipPrecision = CLIP_CHARACTER_PRECIS; |
| 1566 |
VTlf.lfQuality = DEFAULT_QUALITY; |
VTlf.lfQuality = DEFAULT_QUALITY; |
| 1567 |
VTlf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; |
VTlf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; |
| 1568 |
strcpy(VTlf.lfFaceName,ts.VTFont); |
strncpy_s(VTlf.lfFaceName, sizeof(VTlf.lfFaceName),ts.VTFont, _TRUNCATE); |
| 1569 |
} |
} |
| 1570 |
|
|
| 1571 |
void ChangeFont() |
void ChangeFont() |
| 1626 |
VTlf.lfHeight = FontHeight; |
VTlf.lfHeight = FontHeight; |
| 1627 |
VTlf.lfCharSet = SYMBOL_CHARSET; |
VTlf.lfCharSet = SYMBOL_CHARSET; |
| 1628 |
|
|
| 1629 |
strcpy(VTlf.lfFaceName,"Tera Special"); |
strncpy_s(VTlf.lfFaceName, sizeof(VTlf.lfFaceName),"Tera Special", _TRUNCATE); |
| 1630 |
VTFont[AttrSpecial] = CreateFontIndirect(&VTlf); |
VTFont[AttrSpecial] = CreateFontIndirect(&VTlf); |
| 1631 |
VTFont[AttrSpecial | AttrBold] = VTFont[AttrSpecial]; |
VTFont[AttrSpecial | AttrBold] = VTFont[AttrSpecial]; |
| 1632 |
VTFont[AttrSpecial | AttrUnder] = VTFont[AttrSpecial]; |
VTFont[AttrSpecial | AttrUnder] = VTFont[AttrSpecial]; |
| 2819 |
FreeTTDLG(); |
FreeTTDLG(); |
| 2820 |
if (! Ok) return; |
if (! Ok) return; |
| 2821 |
|
|
| 2822 |
strcpy(ts.VTFont,VTlf.lfFaceName); |
strncpy_s(ts.VTFont, sizeof(ts.VTFont),VTlf.lfFaceName, _TRUNCATE); |
| 2823 |
ts.VTFontSize.x = VTlf.lfWidth; |
ts.VTFontSize.x = VTlf.lfWidth; |
| 2824 |
ts.VTFontSize.y = VTlf.lfHeight; |
ts.VTFontSize.y = VTlf.lfHeight; |
| 2825 |
ts.VTFontCharSet = VTlf.lfCharSet; |
ts.VTFontCharSet = VTlf.lfCharSet; |
| 2897 |
|
|
| 2898 |
/* |
/* |
| 2899 |
* $Log$ |
* $Log$ |
| 2900 |
|
* Revision 1.11 2007/08/08 15:56:35 maya |
| 2901 |
|
* 安全な関数を使用するように変更した。 |
| 2902 |
|
* |
| 2903 |
* Revision 1.10 2007/07/10 14:01:46 doda |
* Revision 1.10 2007/07/10 14:01:46 doda |
| 2904 |
* ウィンドウの横幅をある程度より小さくすると、それ以降マウスでのウィンドウサイズ変更が出来なくなる問題を修正した。 |
* ウィンドウの横幅をある程度より小さくすると、それ以降マウスでのウィンドウサイズ変更が出来なくなる問題を修正した。 |
| 2905 |
* |
* |