运行如图所示的代码 则会卡在图片哪里不动 请问如何解决??感谢感谢
#include <graphics.h>
#include <conio.h>
#include<stdio.h>
void picture();
char a;
void main()
{
picture();
printf("yourname:");
fflush(stdin);
scanf("%c",&a);
}
void picture()
{
// 绘图环境初始化
initgraph(640, 480);
IMAGE img;
//加载图片
loadimage(&img,_T("C:\\Users\\Administrator\\Desktop\\113184838971687b0fo.jpg"));
putimage(0,0,&img);
//鼠标
setbkmode(TRANSPARENT);
settextcolor(RGB(139,190,172));
settextstyle(50,0,"Ravie");
outtextxy(255,210,"enter");
MOUSEMSG msg={0};
while(1)
{
msg=GetMouseMsg();
if((msg.x>255&&msg.x<460) && (msg.y>180&&msg.y<300))
{
settextcolor(RGB(0,0,0));
outtextxy(255,210,"enter");
}
else
{
outtextxy(255,210,"enter");
settextcolor(RGB(139,190,172));
}
switch(msg.uMsg)
{
case WM_LBUTTONDOWN:
//printf("请输入A:\n");
if((msg.x>255&&msg.x<460) && (msg.y>180&&msg.y<300))
{
//mciSendString(L"open 1.mp3 alias bk",0,0,0);
//mciSendString(L"play bk repeat",0,0,0);
//getchar();
return;
}
}
}
closegraph();
}
#include <graphics.h>
#include <conio.h>
#include<stdio.h>
void picture();
char a;
void main()
{
picture();
printf("yourname:");
fflush(stdin);
scanf("%c",&a);
}
void picture()
{
// 绘图环境初始化
initgraph(640, 480);
IMAGE img;
//加载图片
loadimage(&img,_T("C:\\Users\\Administrator\\Desktop\\113184838971687b0fo.jpg"));
putimage(0,0,&img);
//鼠标
setbkmode(TRANSPARENT);
settextcolor(RGB(139,190,172));
settextstyle(50,0,"Ravie");
outtextxy(255,210,"enter");
MOUSEMSG msg={0};
while(1)
{
msg=GetMouseMsg();
if((msg.x>255&&msg.x<460) && (msg.y>180&&msg.y<300))
{
settextcolor(RGB(0,0,0));
outtextxy(255,210,"enter");
}
else
{
outtextxy(255,210,"enter");
settextcolor(RGB(139,190,172));
}
switch(msg.uMsg)
{
case WM_LBUTTONDOWN:
//printf("请输入A:\n");
if((msg.x>255&&msg.x<460) && (msg.y>180&&msg.y<300))
{
//mciSendString(L"open 1.mp3 alias bk",0,0,0);
//mciSendString(L"play bk repeat",0,0,0);
//getchar();
return;
}
}
}
closegraph();
}