Lazarus: React to minimization of the application window
Question by Guest | 2015-03-22 at 17:55
I would like to execute some code whenever the user of my application is minimizing the program window. Unfortunately, I cannot find an appropriate event in the window properties (that is TForm). I have searched for something like OnMinimize or alike.
I have found a code for Delphi, but this code is working with Windows messages and I would like to live without them in my application.
Isn't there any simple way in Lazarus? Or do I have to deal with the messages provided by Windows?
Related Topics
MIME Types of Microsoft Office File Formats
Info | 0 Comments
Lazarus/Delphi: Width and ClientWidth - Difference
Info | 0 Comments
jQuery: Assign Action to Keyboard Keys (Keyboard Event)
Tip | 0 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 2: Receiving
Tutorial | 0 Comments
Delphi: System-Wide HotKey
Tutorial | 1 Comment
Delphi/Lazarus: Difference between ParamStr(0) and Application.ExeName
Question | 1 Answer
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Your Form should provide the event OnFormWindowStateChange that is executed whenever something changes at the window (minimizing, maximizing, go back to the normal size).
In this procedure, you can just ask for the current state and execute your desired code:
If the property WindowState of your form has the value wsMinimized, the window has just been minimized, if the property is wsMaximized, the window has just been maximized.
2015-03-23 at 15:29