944,147 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 502
  • C++ RSS
Oct 25th, 2009
0

Expanind DoS Window

Expand Post »
Hey, I have been searching this for a while now, and I cannot find a c++ code that expands the window once opened. I have found multiple codes that claim it opens it in an expanded window, but in the end all I get is compiling errors.

If someone would be so kind as to give a full example code that will open the window in a larger format, it would be greatly appreciated.

Note: I am using Visual Studios Express Edition, not sure if it matters or not..

Edit: I just realized how retarded my typo was on the header. It's supposed to be 'expanded'. Sorry..I'm tired.
Last edited by restrictment; Oct 25th, 2009 at 1:43 am.
Similar Threads
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009
Oct 25th, 2009
1
Re: Expanind DoS Window
This guy can do some amazing stuff with the DOS console window.. best tutorial I've seen for become a master of the console:

http://www.adrianxw.dk/index.html

I think you'd be interested in, "Win32 Console Applications - Part 6"
http://www.adrianxw.dk/SoftwareSite/...Consoles6.html
Last edited by Clinton Portis; Oct 25th, 2009 at 1:58 am.
Reputation Points: 237
Solved Threads: 117
Practically a Posting Shark
Clinton Portis is offline Offline
822 posts
since Oct 2005
Oct 25th, 2009
0
Re: Expanind DoS Window
This guy can do some amazing stuff with the DOS console window.. best tutorial I've seen for become a master of the console:

http://www.adrianxw.dk/index.html

I think you'd be interested in, "Win32 Console Applications - Part 6"
http://www.adrianxw.dk/SoftwareSite/...Consoles6.html
Works Great in how he made the window smaller and then back to normal again...didn't know you could do that.

However, it didn't really show me how to start it in full screen. I am really new to C++, so maybe I missed something..
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009
Oct 25th, 2009
0
Re: Expanind DoS Window
If you want the CMD to be full screen, just press Alt+Enter :/
Reputation Points: 43
Solved Threads: 7
Junior Poster in Training
pspwxp fan is offline Offline
93 posts
since Feb 2009
Oct 25th, 2009
-7
Re: Expanind DoS Window
try this: compiled with vc++ 2008 express
C++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2. #include <iostream>
  3. using std::cin;
  4.  
  5. int main()
  6. {
  7. HWND hWnd = GetConsoleWindow();
  8. ShowWindow(hWnd,SW_MAXIMIZE);
  9. cin.get();
  10. return 0;
  11. }
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Oct 25th, 2009
0
Re: Expanind DoS Window
try this: compiled with vc++ 2008 express
C++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2. #include <iostream>
  3. using std::cin;
  4.  
  5. int main()
  6. {
  7. HWND hWnd = GetConsoleWindow();
  8. ShowWindow(hWnd,SW_MAXIMIZE);
  9. cin.get();
  10. return 0;
  11. }
Thanks for the input...but I still get errors!!
C++ Syntax (Toggle Plain Text)
  1. 1>conversation.obj : error LNK2028: unresolved token (0A0002BF) "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  2. 1>conversation.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
  3. 1>C:\Users\Jake\Documents\Visual Studio 2008\Projects\test\Debug\test.exe : fatal error LNK1120: 2 unresolved externals
  4. 1>Build log was saved at "file://c:\Users\Jake\Documents\Visual Studio 2008\Projects\test\test\Debug\BuildLog.htm"
  5. 1>test - 3 error(s), 0 warning(s)
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009
Oct 25th, 2009
0
Re: Expanind DoS Window
It worked with me..
c++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2. #include <iostream>
  3.  
  4. //maybe you should add this
  5. #pragma comment(lib,"kernel32.lib")
  6. #pragma comment(lib,"user32.lib")
  7. // this will puts a lib-search record in the object file
  8.  
  9. using std::cin;
  10.  
  11. int main()
  12. {
  13. HWND hWnd = GetConsoleWindow();
  14. ShowWindow(hWnd,SW_MAXIMIZE);
  15. cin.get();
  16. return 0;
  17. }
Last edited by cikara21; Oct 25th, 2009 at 5:16 pm.
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
Oct 25th, 2009
0
Re: Expanind DoS Window
Click to Expand / Collapse  Quote originally posted by cikara21 ...
It worked with me..
c++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2. #include <iostream>
  3.  
  4. //maybe you should add this
  5. #pragma comment(lib,"kernel32.lib")
  6. #pragma comment(lib,"user32.lib")
  7. // this will puts a lib-search record in the object file
  8.  
  9. using std::cin;
  10.  
  11. int main()
  12. {
  13. HWND hWnd = GetConsoleWindow();
  14. ShowWindow(hWnd,SW_MAXIMIZE);
  15. cin.get();
  16. return 0;
  17. }
Do you have the express edition?
Reputation Points: 102
Solved Threads: 17
Posting Whiz in Training
restrictment is offline Offline
228 posts
since Oct 2009
Oct 26th, 2009
0

Different Compiler maybe?

Maybe you two could possibly have different compilers?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SCoder1 is offline Offline
24 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: "Requesting" a url without opening a browser
Next Thread in C++ Forum Timeline: Very simple array program (but with a minor glitch)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC