Narue's method should work. But I could not get it to compile in my machine. It needs Windows XP or higher.
Here is a small piece of code that resizes the window. But the dimensions should be specified in pixels, not by the number of characters as in Narue's method.
You can find a Screen Clearing Program in the Code Snippets section submited by vegaseat.
#if (_WIN32_WINNT < 0x0500) // This switch is needed to make the program compile
#undef _WIN32_WINNT // because GetConsoleWindow needs it. See Documentation
#define _WIN32_WINNT 0x0500 // for GetConsoleWindow in MSDN.
system( "pause" );
// Get the window handle for Console Window
HWND hwnd = GetConsoleWindow( );
int newX = 0; // We will ignore this parameter by using the SWP_NOMOVE flag in SetWindowPos
int newY = 0; // We will ignore this parameter by using the SWP_NOMOVE flag in SetWindowPos
int newWidth = 500; // New Width in Pixels
int newHeight = 100; // New Height in Pixels
// Position the console window so that the left and right corners are not changed but the height and width are.
SetWindowPos(hwnd, HWND_TOP, newX, newY, newWidth, newHeight, SWP_NOMOVE); // Using SWP_NOMOVE will cause newX and new Y to be ignored
system( "pause" );
Beats me. Looks like a compiler issue. I dont know dev-cpp so I cant help on that. It ran fine under Visual Studio.Net and Windows 2000, so get someone who knows dev-cpp to figure it out or try using VC++.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"