Peter Kümmel wrote:
Abdelrazak Younes wrote:
Enrico Forestieri wrote:
On Mon, Jan 22, 2007 at 10:56:25AM +0100, Jean-Marc Lasgouttes wrote:

"Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:
@echo off SET LANG=de_DE start "LyX" "lyx.exe" %*
Enrico> Are you aware that the console hiding code is no more in
Enrico> place, such that using a lyx.bat doesn't hide the cmd window
Enrico> anymore?

And I guess this also means that people who preferred to have two
lyx.bat files for two languages, cannot do it anymore.
There was a hidecmd.c wrapper in development/Win32 to hide the console
window without any flashing.
I don't know if anything changed in this domain recently but if I set
the SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" as opposed to "Console
(/SUBSYSTEM:CONSOLE)" I don't see anymore the flashing console.

Peter?

Yes, for a windows application /subystem:windows is the correct setting
(it's a linker option.) But then when texing the console windows pops up,
I assume that this could also be suppressed.

This comment in os_win32.C from Angus should help. I guess there is no problem going this road because we don't use shell script anymore.


        /* Note from Angus, 17 Jan 2005:
         *
         * The code below is taken verbatim from Ruurd's original patch
         * porting LyX to Win32.
         *
         * Windows allows us to define LyX either as a console-based app
         * or as a GUI-based app. Ruurd decided to define LyX as a
         * console-based app with a "main" function rather than a "WinMain"
         * function as the point of entry to the program, but to
         * immediately close the console window that Windows helpfully
         * opens for us. Doing so allows the user to see all of LyX's
         * debug output simply by running LyX from a DOS or MSYS-shell
         * prompt.
         *
         * The alternative approach is to define LyX as a genuine
         * GUI-based app, with a "WinMain" function as the entry point to the
         * executable rather than a "main" function, so:
         *
         * #if defined (_WIN32)
         * # define WIN32_LEAN_AND_MEAN
         * # include <stdlib.h>  // for __argc, __argv
         * # include <windows.h> // for WinMain
         * #endif
         *
         * // This will require the "-mwindows" flag when linking with
         * // gcc under MinGW.
         * // For MSVC, use "/subsystem:windows".
         * #if defined (_WIN32)
         * int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
         * {
         *     return mymain(__argc, __argv);
         * }
         * #endif
         *
         * where "mymain" is just a renamed "main".
         *
         * However, doing so means that the lyxerr messages would mysteriously
         * disappear. They could be resurrected with something like:
         *
         * #ifdef WIN32
         *  AllocConsole();
         *  freopen("conin$","r",stdin);
         *  freopen("conout$","w",stdout);
         *  freopen("conout$","w",stderr);
         * #endif
         *
         * This code could be invoked (say) the first time that lyxerr
         * is called. However, Ruurd has tried this route and found that some
         * shell scripts failed, for mysterious reasons...
         *
         * I've chosen for now, therefore, to simply add Ruurd's original
         * code as-is. A wrapper program hidecmd.c has been added to
         * development/Win32 which hides the console window of lyx when
         * lyx is invoked as a parameter of hidecmd.exe.
         */

Reply via email to