How To Turn On/Off Monitor with Delphi

CK1820 
Created at Feb 10, 2013 09:36:00
Updated at Mar 09, 2024 14:10:14 
173   0   0   0  

In case that you need to shutdown the monitor to conserver power during program execution, you can simple turn your monitor off by calling below function.

uses windows;

SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2);

 

If you need to turn your monitor on, you can do it by calling below function.

uses windows;

SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, $FFFFFFFF);

 

Final tip to let you know is making your monitor to stand by mode which consumes less power.

uses windows;

SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 1);


Tags: Certificate GD TPicture Turn Off Monitor Share on Facebook Share on X

◀ PREVIOUS
How to get application version number in Delphi
▶ NEXT
Delphi Program can command level execution program with hidden mode
  Comments 0
Login for comment
SIMILAR POSTS

How to turn off monitor ? (created at Dec 10, 2008)

How to send char as message to another application (created at Sep 25, 2007)

How to Change the Windows Start button bitmap (created at Sep 18, 2007)


OTHER POSTS IN THE SAME CATEGORY

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

Run PowerShell Command as Administrator in Delphi (updated at Mar 09, 2024)

Run command with Administrator permission in Delphi on Microsoft Windows (updated at Mar 09, 2024)

Delphi code to send data to web server based on POST method (updated at Mar 09, 2024)

Good Delphi components (created at Apr 03, 2016)

How to download/grap web pages or XML document at internet website in Delphi XE? (created at Jul 20, 2015)

Delphi Program can command level execution program with hidden mode (updated at Jan 15, 2024)

How to get application version number in Delphi (updated at Mar 09, 2024)

The Delphi function to get My Videos folder (created at Apr 29, 2011)

Get Application Data Path on Delphi (updated at Mar 09, 2024)

I want to select directory(folder) not file. How can I do that ? (created at Apr 29, 2011)

Changing the Title of a Print Dialog in Delphi (created at Apr 20, 2011)

Auto Logon Programming in Delphi (created at Dec 31, 2010)

Thread Application Implementation in TThread (created at Apr 14, 2010)

Is there directory selection VCL component in Delphi ? (created at Sep 08, 2009)

How to launch application ? (created at Sep 08, 2009)

How to print external document ? (created at Sep 08, 2009)

Delphi API to get windows temporary directory (created at Sep 03, 2009)

Delphi API to get the current working directory (created at Sep 03, 2009)

How to resize PNG file in Delphi ? (created at Sep 03, 2009)

Get the length of arrays and a string (updated at Jan 15, 2024)

Delphi Pointer Types (created at Aug 22, 2009)

UPDATES

Creating a Pinterest-Style Card Layout with Bootstrap and Masonry (created at Apr 24, 2024)

Mastering Excel Data Importation in PHP (updated at Apr 24, 2024)

JSON format control in PHP (updated at Apr 24, 2024)

Equal Height Blocks in Bootstrap with JavaScript (created at Apr 22, 2024)

How to convert integer to text string ? (updated at Apr 22, 2024)

Checking similarity between two strings in PHP (updated at Apr 21, 2024)

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file (updated at Apr 21, 2024)

How do I determine the client IP type (IPv4/IPv6) in PHP (updated at Apr 16, 2024)

How do I determine the client IP type in Python - IPv4 or IPv6 (updated at Apr 13, 2024)

Getting Started with PyTorch: A Beginner's Guide to Building Your First Neural Network (updated at Apr 09, 2024)

Predicting Buyer Preferences with PyTorch: A Deep Learning Approach (updated at Apr 09, 2024)

Forecasting the Weather with PyTorch: A Beginner's Guide to Temperature Prediction (created at Apr 09, 2024)

PyTorch example to Forcast Stock Price based on 10 days Dataset (created at Apr 09, 2024)

Mastering Model Persistence: Saving and Loading Trained Machine Learning Models in Python (created at Apr 08, 2024)

Harnessing the Power of Random Forest Algorithm in Python (created at Apr 08, 2024)

Understanding and Implementing K-Nearest Neighbors (KNN) Algorithm in Python (created at Apr 08, 2024)

Forecasting with Linear Regression and KNN Regression in Python (updated at Apr 07, 2024)

What is 302 Found Redirection in HTTP 1.1? (created at Apr 04, 2024)

Mastering Random Forest Regression: A Comprehensive Guide with Python Examples (updated at Apr 01, 2024)

Python Implementation of Linear Regression (updated at Apr 01, 2024)

Mastering Supervised Machine Learning with Python: A Comprehensive Guide (created at Apr 01, 2024)

Mastering AI: A Beginner's Guide to Python Programming and Beyond (created at Apr 01, 2024)

How do I create animated background for Google Meet? (updated at Mar 28, 2024)

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

How to force cookies, disable php sessid in URL ? (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in Python: Handling A, AAAA, CNAME, and TXT Records (created at Mar 16, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Exploring the Depths of Data Transfer: sendfile vs. kTLS (created at Mar 15, 2024)