Sha256: 131fb602035031f9f89fe076cf3d963c29bd01f006c133f0b934f066e5e37dc2

Contents?: true

Size: 1016 Bytes

Versions: 8

Compression:

Stored size: 1016 Bytes

Contents

##########################################################################
# example_create.rb
#
# Simple test program for the Process.create() method. You can run this
# code via the 'example:create' task.
##########################################################################
require "win32/process"

p Process::WIN32_PROCESS_VERSION

struct = Process.create(
   :app_name         => "notepad.exe",
   :creation_flags   => Process::DETACHED_PROCESS,
   :process_inherit  => false,
   :thread_inherit   => true,
   :cwd              => "C:\\",
   :inherit          => true,
   :environment      => "SYSTEMROOT=#{ENV['SYSTEMROOT']};PATH=C:\\"
)

p struct

=begin
# Don't run this from an existing terminal
pid = Process.create(
   :app_name       => "cmd.exe",
   :creation_flags => Process::DETACHED_PROCESS,
   :startf_flags   => Process::USEPOSITION,
   :x              => 0,
   :y              => 0,
   :title          => "Hi Dan"
)

puts "Pid of new process: #{pid}"
=end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
win32-process-0.8.3 examples/example_create.rb
win32-process-0.8.2 examples/example_create.rb
win32-process-0.7.3 examples/example_create.rb
win32-process-0.7.2 examples/example_create.rb
win32-process-0.7.1 examples/example_create.rb
win32-process-0.6.6 examples/example_create.rb
win32-process-0.6.5 examples/example_create.rb
win32-process-0.6.4 examples/example_create.rb