Jose', pardon the personal mail, but the lyx-devel list seems to be dead ATM.
Paul Rubin, who's been testing lyxpreview2ppm.py under Win32 mentioned a strange problem with gs: > One other thing, which may be unique to the Windows port: whenever > the preview script has to digest a new formula, the call to GS > causes a Ghostscript window to open on top of the LyX window. It > closes fairly quickly, but it's a tad distracting. Probably > nothing you can do about that. There are ways to make a program > open in a minimized window in Windows, but unless the program has a > command line switch to do so (which does not seem to be the case > with Ghostscript), they are at best clunky. It can be done by > calling gs through a batch file, charitably assuming we can get all > the arguments passed correctly, but I'm pretty sure that ends up > being more of an adventure than a typical user would care to face. Not knowing anything about sunch things, I asked on gs-devel: > Now, I know next to nothing about the Windows version of gs. Is is > possible to run it as a command-line tool and explicitly prevent the > window from popping up? Currently, I'm invoking it with: > > gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pnmraw \ > -sOutputFile=<file base>%d.ppm \ > -dGraphicsAlphaBit=4 -dTextAlphaBits=4 \ > -r<resolution> <ps file> To which I received the reply: > Yes, but you can't do it a call to system(). > You need to use the Win32 API CreateProcess. Look at the > STARTUPINFO field wShowWindow. This will work - RedMon uses this > when starting Ghostscript. > > siStartInfo.dwFlags |= STARTF_USESHOWWINDOW; > siStartInfo.wShowWindow = SW_SHOWMINNOACTIVE; > or > siStartInfo.wShowWindow = SW_HIDE; Currently we use popen to launch gs. My question to you is, can we use 'CreateProcess' when on Win32? I couldn't see anything on http://docs.python.org/lib/lib.html but I've probably been looking in the wrong place. Angus