in reply to Re: Win32 wperl open Console when system
in thread Win32 wperl open Console when system

Thanks for your answer, but it doesn answer my question at all !

I'm already running wperl with no problem, except that I need to run a cmd command from it and it always opens an annoying console window just to launch the start command which is immediately exiting.

This is this case I'm trying to solve...

  • Comment on Re^2: Win32 wperl open Console when system

Replies are listed 'Best First'.
Re^3: Win32 wperl open Console when system
by LanX (Saint) on Jan 21, 2020 at 10:49 UTC
    But the linked thread looks good to me.

    Did you look into it and try all listed options?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Yes I did read the threads.

      But my problem is not hiding the console while running a Perl script : I do that by running wperl.

      I just want to run a windows command to display a PDF file FROM wperl that doesn't open a console but only the reader (ie. Internet Explorer).

        The "normal" way to open any file on Windows is to invoke ShellExecute() with hwnd set to 0, lpOperation set to NULL or to "open", lpFile set to the file to be opened, lpParameters and lpDirectory set to NULL, and nShowCmd set to SW_SHOWNORMAL.

        In other words:

        /* In C/C++: */ ShellExecute(0, NULL, file, NULL, NULL, SW_SHOWNORMAL); // request def +ault action ShellExecute(0, "open", file, NULL, NULL, SW_SHOWNORMAL); // request o +pen ShellExecute(0, "print", file, NULL, NULL, SW_SHOWNORMAL); // request +printing

        This should be equal to a double click on the respective file.

        I'm to lazy to search for a module exporting ShellExecute(), Win32::API should be able to import that function from shell32.dll.

        Update: Win32::FileOp exports ShellExecute(). Win32::GUI also has a ShellExecute() method, burried somewhere.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^3: Win32 wperl open Console when system
by Anonymous Monk on Jan 21, 2020 at 12:49 UTC
    I just told you how to hide console and how i found that answer