win32_suspend_process 1.0.0 icon indicating copy to clipboard operation
win32_suspend_process: ^1.0.0 copied to clipboard

Suspend and resume processes on the Windows platform from native dart code.

example/example.dart

import 'dart:io';

import 'package:win32_suspend_process/win32_suspend_process.dart';

void main() {
  // The process id (pid) of the process we wish to suspend.
  // Try it out on something innocuous like notepad.
  final pid = 5588;

  // Instantiate the object representing our process.
  final process = Win32Process(pid);

  // Suspend the process.
  final suspended = process.suspend();
  if (!suspended) {
    // Error handling.
  }
  print('Process suspended.\nWaiting 10 seconds.');

  // Give a chance to see the process is suspended / unresponsive.
  sleep(Duration(seconds: 10));

  // Resume the process.
  final resumed = process.resume();
  if (!resumed) {
    // Error handling.
  }
  print('Process resumed.');
}
2
likes
120
pub points
72%
popularity

Publisher

verified publisher iconmerritt.codes

Suspend and resume processes on the Windows platform from native dart code.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

win32

More

Packages that depend on win32_suspend_process