English Amiga Board


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

 
 
Thread Tools
Old 22 December 2021, 23:50   #1
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
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, 00:20   #2
mateusz_s
Registered User
 
Join Date: Jan 2020
Location: Poland
Posts: 181
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 01:16.
mateusz_s is offline  
Old 14 January 2022, 19:34   #3
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
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, 18:02   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,214
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  
Old 06 February 2022, 17:02   #5
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
In the SAS/C, the __stdiowin variable is used when the program is started from Workbench.

char __stdiowin[]= "CON:10/10/600/100/My Window";

Last edited by Gilloo; 07 February 2022 at 10:49.
Gilloo 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 21:33
Window resolutions (default) Nightshft support.FS-UAE 2 22 December 2020 20:10
Default Window View in WB 3/3.1 manic23 support.Other 3 16 June 2013 13:50
Internal window size changes on theme change mark_k support.WinUAE 2 23 December 2012 21:43
WIndows Default Size cybernoid project.ClassicWB 2 14 April 2007 19: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:49.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11990 seconds with 13 queries