Hello, I'm very proud to introduce a new feature to the VCL Styles Utils project, this is the support for the New Common Dialogs. you can read more on this blog post

Hello, I'm very proud to introduce a new feature to the VCL Styles Utils project, this is the support for the New Common Dialogs. you can read more on this blog post 
 https://theroadtodelphi.wordpress.com/2015/07/13/vcl-styles-utils-now-supports-the-new-common-dialogs/
https://theroadtodelphi.wordpress.com/2015/07/13/vcl-styles-utils-now-supports-the-new-common-dialogs

Comments

  1. As always, awesome job, Rodrigo Ruz !

    ReplyDelete
  2. Great stuff!

    I remember reading somewhere a while back that some of these dialogs used an undocumented DirectX-based windows class, ie were not themeable because they didn't render using Windows theming, at least in part.  (Maybe, eg, the Explorer part was not a normal Explorer control - something along those lines.)  Is my memory completely incorrect / confused, or did you just do some very magical magic?

    ReplyDelete
  3. David Millington, The New Common Dialogs uses a undocumented API called DirectUI, this is  a windowless  UI framework based on DirectX. This API internally uses XML to describe the GUI (Colors, resources, themes) and the uXTheme.dll (Windows Styles) functions to draw the visual elements. Anyway in simply words the "magic" it's done using a set of detours in some WinApi and UxTheme methods.

    ReplyDelete
  4. A word of warning though. Since this is an undocumented interface, one can expect the interface to change in future releases. So one would not be at all surprised for programs built now to fail to run on a future release of Windows.

    ReplyDelete
  5. David Heffernan indeed there is always that risk when you interact with a undocumented API. Anyway I tested this feature across several Windows versions (Vista  to 10 Preview)  and works just fine for now.  Also the library doesn't interact directly with the DirectUI, instead works with the undocumented Windows Styles Parts and States.

    ReplyDelete
  6. Agreed.  It's just something that any users should be aware of so that they can make the decision as to whether or not to rely on undocumented APIs.

    ReplyDelete
  7. David Heffernan , sure, In the next days I will update the wiki of the project adding a detailed description of how this feature works.

    ReplyDelete
  8. Rodrigo Ruz Thanks for the explanation.  I remembered the "Direct" name part and that it was a UI system, but I was rather incorrect really. That's vague memory for you :) Is DirectUI used anywhere else in Windows? I'd be very interesting to read what you know about it, if you put that in the wiki or a blog post.

    ReplyDelete
  9. David Millington It's used extensively by explorer. The tree and list view controls are DirectUI.

    ReplyDelete
  10. David Millington the DirectUI is used widely  by Microsoft on several Apps like the explorer.exe, IExplorer, Common and  Task dialogs, the task manager and so on,  Basically any app using the one of these Windows classes DirectUIHWND, NativeHWNDHost   is using the DirectUI under the hood. The implemetation is located on these files dui70.dll, duser.dll and ExplorerFrame.dll . I will try to find some free time on the next days to write about this. But all the content will based only on my personal  experience and research about this topic, because unfortunately there is not official documentation about it. 

    ReplyDelete
  11. There's no documentation of it because it is a private API. That's not unfortunate. That is normal and reasonable.

    ReplyDelete
  12. David Heffernan indeed, if the Microsoft documentation was available the API was not called undocumented, Anyway when I say "unfortunate", I mean is sad which the DirectUI  is a Private API.

    ReplyDelete
  13. I think it would be great if we could use these controls too.

    ReplyDelete
  14. Yes... I have been wondering if anyone has reverse engineered the API. Some googling indicates no (?), although there are third-party UI frameworks called, confusingly, DirectUI.

    ReplyDelete
  15. David Millington When I start to research on this topic I used  this https://github.com/jameskeane/directui project (is old but very useful),  but finally I ended disassembling the DirectUI API myself using IDA Pro. If you want I can send you those files via email ;)

    ReplyDelete
  16. Sure - although I have no idea what I would do with them, I have no time for yet another project ;)  But it would be interesting, yes :)

    ReplyDelete
  17. In XE7 there is a bug (I reported to EMB) with TButton and styles. If you put two tbuttons on a form and set one of them to Default, when you run the program both buttons are highlighted at the same time if you tab back and forth between them.  This wasn't broken in XE2 but I don't want to revert to that version and tbutton styling in XE6 has a different bug when default is true. Can you suggest a fix for this? I looked at the TButton source code and could not figure it out. Thanks!

    ReplyDelete
  18. David Heffernan  
    I raised it here because the answer on SO doesn't provide a workaround (which I suspect would ultimately mean patching the TButton code) and I wanted to bring it to the attention of Rodrigo since he seems to be a leading expert on styles. As it turns out, contrary to what is posted on SO (including a comment by me), button styling does not work correctly in XE6 (I have yet to check XE3-5). In XE6, the double button problem is not present, but the default button is not shown as selected when another control has focus (like a TEdit). So you get to chose your bug (I would laugh but it's more sad than real).

    ReplyDelete
  19. Tom Tatham I added the link to give Rodrigo some more information. He is the right person to raise this with. Did you consider doing so at his blog, or perhaps he has an issue tracker for his styles projects.

    ReplyDelete
  20. David Heffernan Thanks for the suggestions.l will post on his blog if I can't find an issue tracker. This is so frustrating. It seems that they introduced a bug somewhere between XE3 and XE6 and then replaced that bug with a different one in XE7. How could they have missed this in testing?

    ReplyDelete
  21. Tom Tatham Unfortunately the quality of new library code from Embarcadero has become very low of late.

    ReplyDelete
  22. Tom Tatham I just fixed the issue, please follow the instructions located  here https://github.com/RRUZ/vcl-styles-utils/issues/140

    ReplyDelete

Post a Comment