Created
October 4, 2009 11:52
-
-
Save satyr/201343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use Net::Telnet; | |
use Win32::OLE; | |
my $mr = Net::Telnet->new(Port => 4242, Prompt => '/repl> /', Timeout => 1); | |
$mr->open(); | |
$mr->cmd('{ | |
content.focus(); | |
let Cu = Components.utils; | |
let {ctypes: ct} = Cu.import("resource://gre/modules/ctypes.jsm", null); | |
let k32 = ct.open("kernel32"); | |
let pid = k32.declare("GetCurrentProcessId", ct.stdcall_abi, ct.int32_t)(); | |
k32.close(); | |
pid; | |
}'); | |
my $pid = $mr->getline; | |
Win32::OLE->new('WScript.Shell')->AppActivate($pid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment