new-to-dp 0 Posted June 4 Hi everyone, I will try to keep this brief and clear: I recently started work as a Delphi programmer and our company's programs (many, but not all) have an issue that I wonder could be associated with a template of ours. The issue: Say the program is maximized. Sometimes when we try to then X the program out, it closes whatever other window is maximized behind it. Try again and sometimes it happens again. File | Exit allows me to close the window at hand, but of course it would be nice for the X button to work. As you can imagine, this is really quite an awful issue. I don't have any code or files to replicate the issue at the moment but I do have a question: Has this happened to anyone else ever? new-to-dp Share this post Link to post
Remy Lebeau 1601 Posted June 4 (edited) The behavior you describe suggests your code is handling certain window messages incorrectly, like WM_(SYS)COMMAND or WM_CLOSE. Or your OnClose event handler is doing something weird. The VCL's default behavior when closing a window is to either terminate the app (if closing the MainForm) or hide the window (non-MainForm). The Win32 API's default behavior when closing a window is to destroy the window. Hard to diagnose your problem one way or the other without seeing actual code that reproduces the issue. What does your Exit menu do, exactly? Does it simply close the calling Form, or does it terminate the whole process? Also, you mention a template, what does that mean, exactly? Edited June 4 by Remy Lebeau Share this post Link to post
new-to-dp 0 Posted June 4 (edited) Thank you! Sent this to my boss. It may take a few days to make some progress. I will get back to you on what exactly the exit option does. Template: the programs that have this issue stem all from a particular template. I would like to conclude then that this template has the issue. edit: I have two monitors. Could it be related to that? (ie, when windows are open on both and I go from working in one on one monitor to attempting to close a program on the other monitor) The issue is a bit hard to predict. In the next few days, I will try to replicate it while not connected to the monitors (only on my laptop). Edited June 4 by new-to-dp Share this post Link to post
Remy Lebeau 1601 Posted June 4 1 hour ago, new-to-dp said: Template: the programs that have this issue stem all from a particular template. I would like to conclude then that this template has the issue. What does "template" mean from your code's perspective, though? Are your Forms using a common base class? A common styling theme? Something else? 1 hour ago, new-to-dp said: I have two monitors. Could it be related to that? Doubtful, but anything is possible. Share this post Link to post