ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Programmatically effecting console font colors and size in Delphi console app

<< < (3/3)

kyrathaba:
I've got a good portion of my original goal down: (1) be able to change font and color programmatically.  The only thing I haven't been able to figure out how to do is to change the font size programmatically.  It just doesn't seem that this should be so obscure in a language as well-liked and widely used as Delphi.

No, I wouldn't even consider touching the Registry. 

kyrathaba:
I guess the shortcut route might work, but then the end-user would have to use that particular shortcut to start the program, in order to get the desired font, right?

kyrathaba:
Shortcuts don't change the
font of an existing console. They provide the initial console settings. And
they don't do it by calling any API. The console subsystem parse shortcut
files directly. By the way, when we have a shortcut and set the font
property, a registry key with the same name of the shortcut file will be
added to HKCU\Console, similar to the second method.

f0dder:
Hm, I'm not actually sure whether the shortcut would have to be used to start the application - haven't checked. Back in the days for DOS apps, the settings were iirc read&applied even though you didn't launch the app through the shortcut - dunno if this applies to win32 console mode apps, they are quite different from DOS executables :)

By the way, when we have a shortcut and set the font property, a registry key with the same name of the shortcut file will be added to HKCU\Console, similar to the second method.-kyrathaba (January 18, 2010, 08:58 PM)
--- End quote ---
Didn't know that - but I'd consider it an implementation detail, unless it's clearly documented in some official MS doc.

It just doesn't seem that this should be so obscure in a language as well-liked and widely used as Delphi.-kyrathaba (January 18, 2010, 08:11 PM)
--- End quote ---
It's been quite some years since I used Delphi, but my impression from back then was that the VCL handles standard stuff - if you need something slightly more obscure, especially if it's not super-officially documented, you have to go API?

kyrathaba:
Yep, that's the impression I'm forming as well.

Navigation

[0] Message Index

[*] Previous page

Go to full version