#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#include <time.h>
int main()
{
b();
}
b()
{
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);//移动
main();
}[code=Cpp width=740px][/code]
|