#include <DxLib.h>
#include<windows.h>
#include <stdio.h>
#include <string.h>
#define WD 400
char *mituke;
char *test;
char Key[256];
int R = GetColor( 255, 0, 0 ); //赤
int W = GetColor( 255, 255, 255 );// 白
int B = GetColor( 0, 0, 255 );// 青
int y =0;
int kazu =0;
int hp=200 , hp_max=200;
int ey =20;
char filename[100];
char *text;
/* 置換する。 buf の中の mae を ato にする。成功=1 失敗=0 */
int strrep(char *buf, char *mae, char *ato)
{
char *mituke;
size_t maelen, atolen;
maelen = strlen(mae);
atolen = strlen(ato);
if (maelen == 0 || (mituke = strstr(buf, mae)) == NULL) return 0;
memmove(mituke + atolen, mituke + maelen, strlen(buf) - (mituke + maelen - buf ) + 1);
memcpy(mituke, ato, atolen);
return 1;
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
if( ChangeWindowMode(TRUE) != DX_CHANGESCREEN_OK || DxLib_Init() == -1 )
return -1; //初期化処理
SetMainWindowText("C支援ツール");
int White = GetColor(255,255,255);
while(!ProcessMessage() && !ClearDrawScreen() && !GetHitKeyStateAll( Key ) && !Key[KEY_INPUT_ESCAPE]){
DrawFormatString( 0, 0, R, "<C言語のソースの全角空欄を半角にするおw>");
DrawFormatString( 0, 50, R, "3病後に自動スタート☆");
ScreenFlip() ;
WaitTimer(3000);
break;
}
while(1)
{
FILE *fil;
char *buf;
buf = test;
char *as = text;
fil = fopen("C:/test.txt","r");
fscanf(fil,"%d",&text);//正常終了時の書き込み内容
while(strrep(buf," "," "));
fil = fopen("C:/test.txt","w");
fprintf(fil,"%d",as);//正常終了時の書き込み内容
fclose(fil);
LoadGraphScreen(0,ey,"C:/test.txt",TRUE);
int R = GetColor( 255, 0, 0 ); //赤
int W = GetColor( 255, 255, 255 );// 白
int B = GetColor( 0, 0, 255 );// 青
DrawFormatString( 240, y, R, "内容:%s", text);
WaitTimer(2000);
DrawString( 0 , y , filename , GetColor(0,255,0) );
if(kazu >= 10)
{
goto aa;
}
y = y +20;
ey = ey +20;
kazu ++;
WaitTimer(2000);
}
WaitKey();
aa:
sai:
DxLib_End();// DXライブラリ使用の終了処理
return 0;
}
if (maelen == 0 || (mituke = strstr(buf, mae)) == NULL) return 0;の所です。