Prevent Windows Suspend Mode

Category:
System/API
Type:
Snippets
Difficulty:
Intermediate
Author:
Merrion Computing

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
Most laptop PCs (and some green desktop PCs) will go into a suspended mode to reduce their power consumption after a preset period of user inactivity. However this may interfere with the normal operation of your application if it is watching a named pipe or performing a long operation etc.

The following code prevents windows (NT/2000 and 9x) going into suspended mode.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: