in reply to Re^2: Console Window Minimized
in thread Console Window Minimized

No, I do not misread. A console application (launched from a script) requires a console window. If the script is running in console already then new applicaion uses that console. If the script is executed by wperl (without console window) then the system creates new console window for that application.

I meant that you can start your script in console, then hide it with Windows API function, then call any console application -- all of them will use the hidden console.

I've tested the code before post it. It works as desired.

Also I think that Win32::API::Prototype module is obsolete, you can use pure Win32::API instead of it.

Replies are listed 'Best First'.
Re^4: Console Window Minimized
by slloyd (Hermit) on Sep 20, 2004 at 17:28 UTC
    Thanks for the clarification. I will give it a try.
Re^4: Console Window Minimized
by BrowserUk (Patriarch) on Sep 20, 2004 at 17:31 UTC
    Also I think that Win32::API::Prototype module is obsolete, you can use pure Win32::API instead of it.

    Please clarify?


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      AFAIK Win32::API::Prototype was created when Win32::API had no handy importing style
      use Win32::API; Win32::API->Import( 'mydll', 'int sum_integers(int a, int b)', ); $return = sum_integers(3, 2);

      Yes I know that Win32::API uses eval for importing but it works, so the searching and installing Win32::API::Prototype is not necessary.

      As for Win32::API::Prototype string manipulation functions, they are not seem very useful. I think Win32::API should take care about length of input strings and truncating of output ones. Unfortunately it's not implemented there. May be I'll do it if the author don't.

Re^4: Console Window Minimized
by slloyd (Hermit) on Sep 21, 2004 at 01:07 UTC
    This seems to work except for one catch. When I reboot the computer with the application running Windows kicks an error saying it is unable to end the program. I added the following code to my program but it did not help. When I compile my code with perl2exe using the -gui option, my program exits properly but I get flashing dos windows. Is there a way around this...?
    $SIG{INT}=\&ctrlc; $SIG{HUP}=\&ctrlc; $SIG{QUIT}=\&ctrlc; #Quit $SIG{TERM}=\&ctrlc; #Terminate $SIG{PIPE}='IGNORE'; sub ctrlc{exit;}

      Sounds like your trying to run OS commands in the background without anyone knowing your doing it. I wonder why?


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
        The application that I am building is simply a GUI for dos commands. I used Win32::GUI to build a GUI that allows the customer to enter a DOS command. That command is executed and the results are displayed in a Textfield window. NO, I am not trying to do anything sneaky.