alkaloid has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Perl Console Window
by o(o_o)o (Scribe) on Jan 09, 2002 at 05:53 UTC
    i'm guessing you ment windows ;)
    well.. if you install activeperl from activestate.com it will install a perl binary on your machine, of which you can use that directly... then... you will need both srvany.exe and instsrv.exe from:

    http://www.pyeung.com/userdefinedservice.html

    instsrv is the program that installs srvany as a service... and it's srvany that allows perl program to run...

    follow the instructions on that site about installing a service, but the program you want to install as the service is your path to the perl.exe installed on your computer that comes as part of activeperl.. eg c:\ActivePerl\Perl\bin\perl.exe....

    and also... while still in regedit in the same place as you were while following the other instructions you'll need to do this:

    right click the Parameters key and select new, then String value, then in there type "AppParameters"..

    then... click on AppParameters and click modify and type the path to your .pl perl program.. eg c:\myprogramms\myperlprog.pl..

    close regedit... now when you go to your services part of Windows NT there will be service with the name you specified at the earlier step... you can now click start and stop to control it... :-) i think! i hope so anyway! good luck! i hope that answered the part of the question i could answer.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    i would slit my wrists for you
      i'm such a dummy! better idea than me in the post above, follow the activestate's official explanation of how to do it by going to:
      How do I run a Perl script as a Windows NT Service
      there! silly me! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      i would slit my wrists for you
(ichimunki) Re: Perl Console Window
by ichimunki (Priest) on Jan 09, 2002 at 03:59 UTC
    I have not heard of this "Windoze NT". I doubt there is a Perl module that hooks into that. I have heard of an operating system called "Windows NT" though, for which ActiveState puts out a Perl distribution. They have excellent documentation available online and included in the distribution on the available modules for hooking into the Windows API, and probably the "hide the console" question is answered in their FAQ, since every third Perl/Tk programmer targetting Windows wants to hide the console, and probably many others writing slightly more ethical services don't want their taskbar all cluttered up.

    But if you just want run of the mill spyware, why don't you buy one of several existing packages on the market rather than writing your own?
      A bit off topic, but worth noting, is that with the lates build, Perl/Tk is included in the standard ActiveState Perl distribution.

      This will undoubtedly make it far easier for Perl programmers coding for the Windows audience to incorporate a GUI in their work. It's always been as easy as

         perl -MCPAN -e 'install Tk'
      
      for *nix users, but getting your average Windows user to download the ActiveState installation executable then double-click on it can sometimes be burdensome.

      But if you just want run of the mill spyware, why don't you buy one of several existing packages on the market rather than writing your own? There's no challenge in that, now is there?
Re: Perl Console Window
by jplindstrom (Monsignor) on Jan 12, 2002 at 19:21 UTC
    You can, maybe, use Win32::GUI.

    When you log the keystrokes (I understand you have that covered already) you can check the window title of the topmost window like this:

    my $title = Win32::GUI::Text(Win32::GUI::GetForegroundWindow()) or war +n("No title\n");

    I don't really see the need for runnign this as a Service.

    If you start the script using wperl.exe instead of perl.exe, there will be no DOS window visible.

    You can also create a standalone .exe file using PerlApp (from ActiveState's PDK) and use the -gui option which will suppress the DOS window. This is better if you need to install it on computers with no Perl installed.

    If what you want to do is to start the script automatically, create a shortcut in the Autostart or Startup program folder.

    /J

      Thank you very much for your help. I got the impression that you might have some ideas about the keystroke logging as well...any info you might have would be helpful, because we do have the script logging keys, but only in a console window. We need to have it logging _all_ keystrokes and have currently turned our attention towards doing some assembly. If you have any ideas on using Perl for this, it would help us out greatly. Thanks again.