Hi, I want to make my app disappear when the user double clicks on the title bar (just like a Linux app) so all that remains is the title bar, and when they double click on the title bar again the window animates back to its former self. Can anybody help me with this?
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
Scott, I was intrigued to note that you used Delphi 5 for this and I would have assumed, you being at Prestwood that D7 would have been standard - I was just interested.
Thanks for the info Scott. I also posted this message in a delphi newsgroup and someone posted some code that works except I forgot to mention that I wanted the window to restore when double clicked again. But I have more to work on now so that's great.
I'm interested in looking at your demo app as well so if you wanna send it to merlin73@iprimus.com.au I would appreciate it.
One more question how can I add a button to the title bar? I was thinking it might be easier to "shrink/unshrink" my form with a customized button that sits next to the minimized button. I had a look in the help files, but only found info for disabling the 3 regular buttons.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
Thanks for the zip Scott. Unfortunately I couldn't examine it. I'm using Netscape on Linux and when I extracted it from the email it must have stuffed it up. No problem though... I've already found the code I needed for my program.
As for the buttons on the title bar, I know it can be done (although I don't know how). I've got a winamp plugin that puts all the winamp controls on any window that has focus next to the min/close buttons. But as I'm only a beginner programmer it sounds like it would be a lot of work to do something like that, so I think I'll forget about it for now.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
Well, you'll be interested to know what events fire when you double-click the title bar...
One would think that the logical form event would be OnDoubleClick, but that is not the case.
To research answers on this forum, I always like to throw together quick little demo apps to test before I give an answer. I built a test app that was just a simple form with event counters and labels showing the event count. I can email you the Delphi 5 project if you're interested in what I did.
When you double-click, of course, the default action is to maximize the form. Double-clicking the title bar is the exact same behavior as clicking the Maximize/Restore button on the Windows system menu on the title bar (the three icons in the upper-right corner).
What I found was that when you double-click the title bar, this triggers the OnResize event, the OnCanResize event, the OnResizeQuery event, and the OnConstrainedResize event, but no other events on the form!
Even more confusing is that when you double-click the title bar the second time, no events are triggered - not even OnResize or OnShow!
So, you'll have to tinker with this behavior, but I think you are going to have to modify the OnCanResize event to shrink the form to just the title bar - rather than maximizing the form. Since the second "double-click" sends out the Windows RESTORE event (which does not appear to be trapped), the form will most likely return to the last size it was when it is restored.
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
No, we use D5 and D6 here. We have not jumped on D7 yet. The only reason we would justify the upgrade is if we have a .Net project.
D6 is sufficient for 90% of our projects. I use D5 mostly for projects we sub-contract on (where the contractor is fully D5), or for simple things like this. I consider D5 to be the "baseline" for Delphi versions right now.
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
Well, my findings about the events that get triggered should give an indication of the answer...
It is my understanding that the frame of your form - which includes the title bar - is the result of the underlying CreateWindowsEX call - which is Windows SDK. The VCL just simplifies this call by doing the dirty work for you in the TForm's constructor.
So for a standard form, you can't add buttons to the System menu or the title bar - that's Windows domain, not Borland.
But I have been told many times that there is nothing that can't be done in Windows programming if you want to do it. I've done my fair share of inherited forms, and plenty of spelunking into the VCL source to find hidden functionality, but based on what I've found so far, I don't see how you could modify what Windows gives you here.
This may call for a trip to the "Secrets of Win32 Programming" book, or some other reference that goes beyond what Delphi has to give.
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.