写一个五子棋c语言程序,如何写鼠标点击功能,请高手帮我写一个通俗易懂的。
#包含" stdafx.h "
# include & ltwindows.h & gt
# include & ltconio.h & gt
# include & ltstdlib.h & gt
int main(int argc,char* argv[])
{
setconsolettitle(" 1111111111 ");
HANDLE hInput = GetStdHandle(STD _ INPUT _ HANDLE);//获取标准输入设备句柄
INPUT _ RECORD inRec
DWORD res
while (1)
{
ReadConsoleInput(hInput & amp;inRec,1 & amp;RES);
如果(inRec。鼠标事件。& ampin rec . event . mouse event . dwbuttonstate = = from _ Left _ 1st _ button _ pressed)//鼠标左键
{
SetConsoleCursorPosition(GetStdHandle(STD _ OUTPUT _ HANDLE),inRec。event . mouse event . dw mouse position);
printf("Hello World!");
}
睡眠(100);
}
返回0;
}