当前位置:淘百问>百科知识>CHANDLE hOut = GetStdHandle(STD_O来自UTPUT_HANDLE

CHANDLE hOut = GetStdHandle(STD_O来自UTPUT_HANDLE

2024-04-19 17:18:43 编辑:join 浏览量:588

问题补充说明:voidgotoxy(intx,inty)//x为列坐标,y为行坐标{COORDpos={x,y};HANDLEhOut=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOut,pos);}这些语句代表什么,在哪个包里?... void gotoxy(int x, int y)//x为列坐标,y为行坐标{COORD pos = {x,y};HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(hOut, pos);} 这些语句代表什么,在哪个包里? 展开

CHANDLE hOut = GetStdHandle(STD_O来自UTPUT_HANDLE

亚况控制台:清屏,goto述xy

#include<windows.h>

#include<stdio.h>

#include<stri答压松怀零苏求家微家ng.h>

voidCls(HANDLEhConsole);

voidgotoxy(HANDLEhOut,intx,inyy);

intmain()

{

DWORDstate=0,res;

HANDLEhOut=GetStdHandle(STD_OUTPUT_HANDLE);

Cls(hOut);

gotoxy(hO证模坐盾才ut,5,5);

printf("position:5,5\n")这句;

CloseHandle(hOut);

}

voidCls(HANDLEhConsole)

{

COORDcoordScreen=;

BOOLbSuccess;

DWORDcCharsWritten;

CONSOLE合意轻试亚映衣晚_SCREEN_BUFFER_INFOcsbi;

DWORDdwConSi临划通械无附利著呢着志ze;

bSuccess=Ge座植支香显tConsoleScreenBufferInfo(hConsole,&csbi);

dwConSize=csbi.dwSize.X*csbi.dwSize.念余Y;

bSuccess=FillConsoleOutputCharacter(hConsole,(TCHAR)'',dwConSize,coordScreen,&cCharsWritten);

bSuccess=GetConsoleScreenBufferInfo(hCo同末亮充药委己获死nsole,&csbi);

bSucc光文管阶何获轮酸并ess=FillConsoleOutputAttribute(hConsole,csbi.wAttributes,dwConSize,coordScreen,&cCharsWritten);

bSuccess=SetConsoleCursorPosition(hConsole,coordScreen);

}

voidgotoxy(HANDLEhOut,intx,inyy)

{

COORDpos;

pos.X=x;

pos.Y=y;

SetConsoleCursorPosition(hOut,pos);/*设置光标位置*/

}

标签:CHANDLE,hOut,GetStdHandle

版权声明:文章由 淘百问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.taobaiwen.com/article/419927.html
热门文章