Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

I need screen resolution testers

C++ Stuff belonging in global scope pretty much

I need screen resolution testers

Postby noobgrammer on Sun Oct 18, 2009 5:37 pm

Hello I'm looking for some screen resolution testers to see if the screen will change sizes for you or if you have to go and change your properties settings. The screen should first be big to where the numbers are just shy from hitting the edge the it will resize back to the original size with the same results

Code: Select all
#include <iostream>
#include <windows.h>

int main()
{
   HWND console = GetConsoleWindow();
   RECT r;
   GetWindowRect(console, &r);

    MoveWindow(console, r.left, r.top, 1024, 768, true);
   
   for (int i = 0; i < 65; i++)
   {
      std::cout<< i;
   }
   std::cout<< "\n";
   
   for (int i = 1; i < 58; i++)
   {
      std::cout<< i << "\n";
   }

    Sleep(5000);
   system("cls");
   
   
   MoveWindow(console, r.left, r.top, r.right - r.left, r.bottom - r.top, true);

   for (int i = 0; i < 44; i++)
   {
      std::cout<< i;
   }

   std::cout<< "\n";
   for (int i = 1; i < 24; i++)
   {
      std::cout<< i << "\n";
   }
   

}


if it doesn't get bigger than you would have to right click on the top of the command prompt window and click on properties and click on the layout tab and change the screen buffer size to something like 200 x 100. give me some replies if it worked for you without having to change your settings or if you had to

thanks
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: I need screen resolution testers

Postby glinka57 on Mon Oct 19, 2009 12:14 am

Nice, the window was larger but it only stayed at athat size then closed. I'll try to post an update to this, but I think those settings can only be changed once, (when windows calls it) and not during program execution. or maybe not, I'll take a look
User avatar
glinka57
 
Posts: 195
Joined: Fri Feb 27, 2009 7:32 pm

Re: I need screen resolution testers

Postby noobgrammer on Mon Oct 19, 2009 4:20 am

I was using sleep for 5 seconds and yes you can change it to different sizes. I just had to adjust the properties on my PC first to get it to work

the bottom command will change it back to default size


this one should be self explanatory
Code: Select all
MoveWindow(console, r.left, r.top, 1024, 768, true);


default
Code: Select all
MoveWindow(console, r.left, r.top, r.right - r.left, r.bottom - r.top, true);
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron