2006/6/7, Robert May <[EMAIL PROTECTED]>:
Glenn Linderman wrote:
> On approximately 6/6/2006 2:08 PM, came the following characters from
> the keyboard of Robert May:
>> Reini Urban wrote:
>>> Robert May schrieb:
>>> ...
>>>> If only there was a way to ask AllocWindow() to create a hidden console,
>>>> but I read that it's impossible.  (I do want to explore the possibility
>>>> of using a global hook to see if I can catch one of the messages that
>>>> happens early during window creation, and fiddle the WS_VISIBLE style,
>>>> but I'm not hopeful!)

I can confirm that as I read elsewhere, it does not seem possible to
either subclass or hook (SetWindowsHookEx(WH_CBT, ...)) a console window.

>>> You can create it offscreen, to the right or left.
>>> So you can use CreateProcess() with
>>> dwCreationFlags += CREATE_NEW_CONSOLE, instead of AllocConsole()
>>>
>>> And STARTUPINFO.dwX holds the offscreen position.
>> Interesting idea, but I don't think I'm following you here.
>> CreateProcess() will create me a new process, and I can't see how I'd
>> read/write to that process's console from my perl script.
>>
>> Regards,
>> Rob.
>
> It seems that Reini's idea might be useful to stop flashing consoles for
> subprograms, but not for the original program?

That was my thinking too - but perhaps Reini is
hinting at something that I do not understand?

No, I mixed it up.
perl2app --gui / pp --gui  created apps, have no console.
So I create them with AllocConsole or CreateProcess and
redirect STDERR/STDOUT to this window, and display it only when requested.
To work around the flashing issue I can
1) create it only when requested, but then I loose the previous output,
2) or create it hidden or offscreen and show/move it when requested.
Menu: View - Messages...

But better is to create the app without --gui and hide the console as
discussed here.

If you want to start a sub-process hidden, then
   Win32::SetChildShowWindow(SW_HIDE);
is probably easier :-)

Correct.

--
Reini Urban
http://phpwiki.org/
http://spacemovie.mur.at/   http://helsinki.at/

Reply via email to