[GRASS-dev] db_start_driver without window

Markus Neteler neteler at osgeo.org
Thu Oct 15 00:00:42 PDT 2015


On Wed, Oct 14, 2015 at 7:39 PM, Radim Blazek <radim.blazek at gmail.com> wrote:
> When a driver is started from QGIS on Windows using db_start_driver ->
> G_spawn_ex -> do_spawn -> win_spawn > CreateProcess, it opens black
> window.
>
> Is there a possibility to prevent opening that window by setting some
> global Windows param before db_start_driver is called? If not, would
> it be possible to prevent it by giving
> CREATE_NO_WINDOW (or something like that) as dwCreationFlags to
> CreateProcess in win_spawn?

At time I see the 0 hardcoded in the function all in
lib/gis/spawn.c

static int win_spawn(const char *cmd, const char **argv, const char **envp,
    const char *cwd, HANDLE handles[3], int background,
    int shell)
[...]
 result = CreateProcess(
  program, /* lpApplicationName */
  args, /* lpCommandLine */
  NULL, /* lpProcessAttributes */
  NULL, /* lpThreadAttributes */
  1, /* bInheritHandles */
  0, /* dwCreationFlags */
  env, /* lpEnvironment */
  cwd, /* lpCurrentDirectory */
  &si, /* lpStartupInfo */
  &pi /* lpProcessInformation */
);

@devs: related documentation:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
--> therein page ref with the of "Process Creation Flags"
    --> CREATE_NO_WINDOW

Did you try and this works then?

Markus


More information about the grass-dev mailing list