a perenial questions raised in PBCC is
"How can I control the <Windows default> font for a console app from within the app?"
UCR: "Can't be done, can't change the font of a running console."
it's now time to get devious:
one can set the Windows font via right-click|Properties, use for all future Windows of this name, etc.
now, as a point of obvious fact, the information - "use this font for all windows named X" - is written to some file,
somewhere within the Windows system, register, <whatever>.
there is no application fairy that swoops down on every computer whenever app X is launched to "make things right"
so, if the following points are true:
- the pbcc .exe can determine the screen resolution of the running monitor
- the pbcc .exe can determine the font size currently being used for the pbcc console window
- the location of the stored info "use this font for app X" is known and can be "rewritten"
- a pbcc .exe can shell out, launch of copy of itself, and terminate async
it would seem possible to:
(a) determine font in use
(b) decide whether font in use is appropriate for the application needs based on display resolution
(c) if (b) not true, re-write "?file?data?" as if the user had changed font to an appropriate font size/style
(d) shell launch itself and terminate first copy.
(e) effectively "controlling" the font of a running console window.....
since the change to an appropriate font via "?whatever?file?data?" is "permanent" - this is probably a "run once" type scenario.
changing font multiple times within the app would have some serious drawbacks if implemented via this scheme.
personally, I'll settle for half-a-loaf.
anyone tries this approach?
too far out in left field?
------------------
Comment