[Bf-committers] Console on Windows Build

Joshua Warner joshuawarner32 at gmail.com
Mon May 17 06:44:39 CEST 2010


I'm pretty sure that you can do this with the Windows API - its just not
quite as simple as in *nix.
Look at the documentation for the AttachConsole Windows API
function<http://msdn.microsoft.com/en-us/library/ms681952%28VS.85%29.aspx>.
All that needs to be done is to configure Blender to not run in a console
(by implementing WinMain instead of main), the call AttachConsole(-1), to
try attach to the parent process' console.  If the parent process doesn't
have a console (as will be the case when launched from the start menu, for
instance), the function will just return FALSE, but otherwise do nothing.

As for converting the prints that go directly to the system console, I don't
think this is necessary - there is a whole family of Windows API functions
for capturing input programatically from a console, even when that console
is attached to the current process.  I'm not sure how this works in *nix,
but I expect something similar could be done.

-Joshua

On Sun, May 16, 2010 at 10:24 PM, Joshua Leung <aligorith at gmail.com> wrote:

> AFAIK, Windows does not allow this sort of hybrid approach (writing
> console output only when started from a console), otherwise we'd have
> done it already. Only *nixes tend to do this. On Windows, it's either
> an all or nothing - no console or with console compile-time factor.
>
> Secondly, there are still quite a few prints that go directly to the
> system console directly, so those would need to be dealt with before
> we could completely consider distributing "console" versions and
> "without-console" versions.
>
> On Mon, May 17, 2010 at 3:48 PM, Roger Wickes <rogerwickes at yahoo.com>
> wrote:
> > i think windows people can always start blender from a command prompt
> > window, so there is no need for a separate console when started.  Same
> > as Linux and Mac folks.
> >
> > My main use of the terminal window is to watch the sequencer slew thru
> > my video. So I usually click Anim, minimize the UI, and watch for the
> terminal to
> > stop changing.
> >
> >  --Roger
> >
> >
> >
> >
> > ________________________________
> > From: Benjamin Tolputt <btolputt at internode.on.net>
> > To: joshuawarner32 at gmail.com; bf-blender developers <
> bf-committers at blender.org>
> > Sent: Sun, May 16, 2010 11:20:46 PM
> > Subject: Re: [Bf-committers] Console on Windows Build
> >
> > Joshua Warner wrote:
> >> Please forgive me if this has already been discussed.  Given that there
> is a
> >> "console" window type in the Blender 2.52 build, is there a potential
> for
> >> removing the console that launches alongside the main Blender window?
>  This
> >> would make Blender fit in better with other Windows applications and
> also
> >> make it easier to manage multiple separate Blender instances.
> >>
> >
> > So long as the error messages that are thrown into the Windows console
> > are available somewhere for us to see when an import goes bad (or
> > similar), I think it would be good to do away with it myself.
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> >
> >
> >
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> >
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list