#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
void FullScreen(){
HWND hwnd=GetForegroundWindow();
int x=GetSystemMetrics(SM_CXSCREEN)+300,y=GetSystemMetrics(SM_CYSCREEN)+300;
char setting[30];
sprintf(setting,"mode con:cols=%d lines=%d",x,y);//设置控制台行数列数
system(setting);
SetWindowPos(hwnd, HWND_TOPMOST,0,0,x+300,y+300,NULL);//置顶
MoveWindow(hwnd,-10,-40,x+300,y+300,1);//移动
printf("\n\n");
}
int main()
{
FreeConsole();
Sleep(2000);
FullScreen();
getchar();
return 0;
} |