Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    But when you make the application handle the popup parent, there's nothing to keep the modal form on top of the main form. This conversation is going nowhere. You really do need to understand what popup parent is.
  2. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    You don't want to make the application window the popup parent. Then your dialog can appear behind the main form. You want the main form to be the popup parent. Which you can do in CreateParams, or by setting PopupParent. It's important that you understand what popup parent aka Window owner in Windows terminology means. At the moment you seem to be trying stuff without understanding it. I think I already explained that destroying the window is the key to getting the behaviour you want. I gave you two options for doing that.
  3. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    I don't understand what you mean with these two handles. I guess you are talking about the popup parent. You can set this more easily with the VCL PopupParent property. The right thing to set it to is the main form. Do you understand what the popup parent is, aka window owner in Windows terminology?
  4. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    So I think that this behaviour happens because the window is not destroyed. If you make the analagous WinForms app then you don't see this behaviour. I believe that's because that framework destroys the window when the modal dialog is closed. You can achieve the same thing by, guess what, destroying the form object. That's really the best approach. I can't stress strongly enough that's what you should do. You could also achieve the same effect by forcing the window to be destroyed. Call DestroyWindow on the modal form when it closes. That forces windows recreation the next time you show it. Perhaps that's safe to do. I wouldn't do it. I'd do it the right way. Embarcadero are never going to "fix" this because it would require a complete redesign of the VCL. Not going to happen.
  5. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    FWIW it is less nasty if you pass the main form as the owner of the dialog when you create it. You pass Application as the owner. Actually, I'm not sure that's true having played around a bit more.
  6. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    It's worth pointing out that this preview is drawn by the system. It's entirely plausible that there's nothing that Embarcadero could do to change the behaviour.
  7. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    OK. Carry on the way you are doing it, and accept the preview oddity. I'm just trying to describe how to avoid that. But maybe it's less important to you.
  8. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    So store the data in a collection and populate from that. Instant. And it's better not to use visual controls as data stores. They should just present views. Destroying the form when you close it solves your problem. And the performance issue is easily dealt with as I have described.
  9. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    Not so. Populating a combo takes no discernible time. Try measuring it.
  10. David Heffernan

    SetFocus issue

    Well, I guess it's clear now that the issue is not Delphi, but rather what your ActiveX control does. Perhaps it's worth asking the vendor.
  11. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    What is the downside of creating the form when you need it and destroying it when it is closed?
  12. David Heffernan

    Delphi 2007 to 10.3 and Windows 10 taskbar issue

    Destroy the form when you close it. It's as simple as that. If you want to preserve some state between invocations, put that in a separate object. Forms should just present views anyway, and not be part of your apps business logic.
  13. David Heffernan

    SetFocus issue

    That's not an issue with focus. It's an issue with window owner, or popup parent in VCL terminology.
  14. David Heffernan

    SetFocus issue

    What happens if you don't call LoadFile?
  15. David Heffernan

    optset files

    I use them to apply the same options to all my various projects. They work quite nicely. It means that if ever I change an option, or make a new project, I can roll it out effortlessly, and with confidence.
  16. David Heffernan

    Form no longer repaints after WM_SETREDRAW

    This is the wrong way to deal with flicker. Do it the right way and this problem vanishes.
  17. David Heffernan

    jpg validation

    I'd start by identifying the problem. Don't try to solve problems you don't understand.
  18. David Heffernan

    jpg validation

    I'd want to fix the code first. There should be two try/finally blocks and no try/except block. MotionBitmap1.Canvas.Lock; try jpeg := TJPEGImage.Create; try jpeg.Assign(MotionBitmap1); jpeg.SaveToFile('D:\picture.jpg'); finally jpeg.Free; end; finally  MotionBitmap1.Canvas.Unlock; end; And I don't know whether or not the lock/unlock is necessary. Why did you include it? As for checking whether or not it worked, there's no point. What failure more do you have in mind?
  19. Maybe this is time to do it the right way? Given that you have to change.
  20. The value is that you have the images in a useful form, not trapped in some weirdo base16 dfm format. You have names for your images, and not just integer indices.
  21. Images should not be stored in dfm files. They should be held in their original format and linked as resources.
  22. David Heffernan

    ICS - Internet Component Suite

    Easily resolved by removing F-Secure. As with so many anti virus products the cure is so much worse than the disease.
  23. David Heffernan

    PopMenu two levels down..

    This is a good example of why making a clean reproduction of an issue is such a useful discipline.
  24. David Heffernan

    The beauty of class and record helpers

    You can implement a helper the way you expect, but mutating methods on value types is troublesome. Imagine passing such a type as a const param and then calling such a method. Because Delphi lacks const methods (as found in C++), such things cause havoc.
  25. David Heffernan

    UCS4Strings

    I've not ever looked at this function but it's not hard to see what must be going on. There is no 4 byte string type. So you'll be getting a dynamic array back. And there will be a null terminator as there is for all non short string types. But since there is no compiler support for treating the type as a string, you just get the dyn array length function, which counts the null terminator.
×