Close Window via PostMessage - Delphi

DarkCoderSc
Jean-Pierre LESUEUR
var ATargetWindow := FindWindow(nil, 'Untitled - Notepad');
if ATargetWindow = 0 then
Exit();
PostMessage(ATargetWindow, WM_CLOSE, 0, 0);
Creating and researching code snippets takes time and effort. You’re welcome to share them through your own platforms, but please don’t forget to credit the original author, here: Jean-Pierre LESUEUR.
Implemented By Technique
Featured Windows APIs
Created
April 24, 2025
Last Revised
April 24, 2025