English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 23 December 2021, 00:50   #1
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 107
How can I change default output console window size?

When I am using in my C code, under AmigaOS 3.2
printf("ABC");

the default console opens and writes that. But I would like to setup
that console windows size first.

I tried:
BPTR consoleFH = Open("CON:20/20/500/100/Console", MODE_OLDFILE);
SelectOutput(consoleFH);


It only opens additional window, but output is still in the first default window.

Thank You in advance
mateusz_s is offline  
Old 23 December 2021, 01:20   #2
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 107
Quote:
Originally Posted by mateusz_s View Post
When I am using in my C code, under AmigaOS 3.2
printf("ABC");

the default console opens and writes that. But I would like to setup
that console windows size first.

I tried:
BPTR consoleFH = Open("CON:20/20/500/100/Console", MODE_OLDFILE);
SelectOutput(consoleFH);


It only opens additional window, but output is still in the first default window.

Thank You in advance

Hmmm.. I figure out something like that. It works.
Is that a correct way?
Code:
BPTR consoleFH = Open("CON:50/50/400/250/Console/", MODE_NEWFILE);

const char* abc = "ABCSS";
Write(consoleFH, abc, strlen(abc));

// at the end
// Close(consoleFH);

Last edited by mateusz_s; 23 December 2021 at 02:16.
mateusz_s is offline  
Old 14 January 2022, 20:34   #3
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 936
Hi @

I think that what you do is correct but have a look here, thanks to a lot of help from others here, this code illustrates how to deal with the Console

Cheers!
tygre is offline  
Old 15 January 2022, 19:02   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,593
Quote:
Originally Posted by mateusz_s View Post
When I am using in my C code, under AmigaOS 3.2
printf("ABC");

the default console opens and writes that. But I would like to setup
that console windows size first.

I tried:
BPTR consoleFH = Open("CON:20/20/500/100/Console", MODE_OLDFILE);
SelectOutput(consoleFH);


It only opens additional window, but output is still in the first default window.

What the compiler opens as default console if not run from the shell is pretty much compiler specific. Some compilers allow to define the path and by that also the size of the console window they open for stdout. Thus, either consult the compiler manual of the compiler you are using, or provide details on your C compiler.
Thomas Richter is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
console debugger size issue Cyprian support.WinUAE 1 24 September 2021 22:33
Window resolutions (default) Nightshft support.FS-UAE 2 22 December 2020 21:10
Default Window View in WB 3/3.1 manic23 support.Other 3 16 June 2013 14:50
Internal window size changes on theme change mark_k support.WinUAE 2 23 December 2012 22:43
WIndows Default Size cybernoid project.ClassicWB 2 14 April 2007 20:11

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.07006 seconds with 15 queries