1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <iostream>
//the following line is necessary for the
// GetConsoleWindow() function to work!
//it basically says that you are running this
// program on Windows 2000 or higher
#define _WIN32_WINNT 0x0500
#include <windows.h>
using namespace std;
int main()
{
// Get the console handle
HWND console = GetConsoleWindow();
//MoveWindow(window_handle, x, y, width, height, redraw_window);
MoveWindow(console, 100, 100, 100, 100, TRUE);
Sleep(1000);
MoveWindow(console, 200, 200, 200, 200, TRUE);
Sleep(1000);
MoveWindow(console, 300, 300, 300, 300, TRUE);
Sleep(1000);
MoveWindow(console, 400, 400, 400, 400, TRUE);
Sleep(1000);
MoveWindow(console, 500, 500, 500, 500, TRUE);
return 0;
}
| |