-
Content Count
96 -
Joined
-
Last visited
Everything posted by bravesofts
-
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts posted a topic in Windows API
hello every one my question is : Will Embarcadero Integrate UWP & WinUI in the Upcoming RAD Studio Versions? For years, Embarcadero has been a leader in wrapping and integrating native APIs seamlessly into RAD Studio, allowing Delphi and C++Builder developers to interact with platform-specific features with minimal effort. From Win32 to FireMonkey, from VCL to the FMX framework, RAD Studio has consistently evolved to support modern development needs. However, as we move further into the Windows 11 era, one question remains: Why hasn’t Embarcadero fully embraced UWP (Universal Windows Platform) and WinUI , despite the fact that it has successfully wrapped almost every other aspect of Windows development? A History of Embarcadero’s API Wrapping Success Embarcadero has a proven track record of abstracting complex platform-specific technologies into developer-friendly interfaces. A perfect example is how they handled Android development—by implementing a powerful JNI bridge, they successfully enabled Delphi developers to access and use Android native libraries in a fluent, object-oriented manner. The TImport<T> generic approach allowed Delphi developers to seamlessly bind Java static class methods to their object or instance methods, making Android development feel natural and productive inside Delphi. This was a massive success, removing the usual pain points of dealing with JNI manually. The Case for UWP and WinUI Now, let’s talk about Windows. Microsoft’s WinUI 3, the latest iteration of its modern Windows UI framework, is positioned as the future of Windows desktop applications. While VCL remains the most powerful and native way to develop Win32/Win64 applications, many developers are looking toward modern UI frameworks like WinUI to future-proof their applications. Delphi already provides built-in support for WinRT, offering low-level access to Windows Runtime APIs. However, full-fledged support for WinUI controls inside the VCL/FMX framework is still missing. While developers can manually use XAML Islands, the process is cumbersome and lacks true design-time integration inside the Delphi IDE. What Could Embarcadero Do? Introduce Direct WinUI Controls Support in VCL and FMX: Embarcadero could wrap WinUI 2 & WinUI 3 &+ controls in a native VCL/FMX layer, similar to how TEdgeBrowser integrates WebView2. Provide XAML Island Support with Design-Time Integration: Currently, manually embedding XAML Islands is complex. RAD Studio could add native support for hosting XAML controls inside TForm with a corresponding manifest key to make XAML Island design-time integration seamless. Enhance the Windows Runtime (WinRT) API Integration: While Delphi has WinRT bindings, they could be extended to support higher-level abstractions, making them easier to use within VCL and FMX applications. A Golden Opportunity for Embarcadero Many of the requested features could be easily implemented with the Universal Windows Platform. However, the application is complex, and it's the outcome of many years of development by different teams. As such, rewriting it from scratch with a new technology like FMX or (VCL + TDirect2DCanvas or StyleControls ThirdParty Lib or Fake Windows10 Controls like TSplitView, TSearchEdit, TRelativePanel, TToggleSwitch, TActivityIndicator, TNumberBox, TDatePicker and so on ?) isn't an option on the table!!. Embarcadero has always been at the forefront of making complex API interactions simple. It was true when Borland embraced Win32 in its golden age, and it remains true today with the success of FireMonkey and the JNI Bridge. With built-in support for WinRT already in place, the next logical step is to wrap WinUI 2 & 3 &+ controls and integrate them into the Delphi IDE. This would bring native, modern UI capabilities to RAD Studio while maintaining Delphi’s ease of use and productivity. While Embarcadero still hasn’t embedded XAML Islands into the IDE, Delphi developers are logically losing access to a wealth of golden libraries that could otherwise be leveraged in Delphi desktop applications. The longer this remains unsupported, the more opportunities are missed to modernize Windows application development in Delphi. Final Thoughts: The Future of Delphi & RAD Studio With Windows 11 pushing developers toward WinUI 2 & 3 &+ and modern app architectures, it’s time for Embarcadero to take the next step. The same ingenuity that led to the powerful Win32 wrapped controls by Borland before and the successful WinRT Bridge units should now be applied to WinUI 2 & 3 &+, allowing Delphi developers to build truly modern Windows applications while keeping the performance and simplicity they love. So, the big question remains: Will we see a WinUI integration in the next version of RAD Studio? We certainly hope so! 🚀 -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
At the very least, Embarcadero should provide a solid wrapper for the OS compositor’s rendering Layers—both Windows.UI.Composition and Microsoft.UI.Composition—similar to what they did with TDirect2DCanvas. WinUI isn’t just about UI controls. Handling XAML, controls, and manifest configurations based on OS requirements is something that developers can manage themselves—whether through their own development efforts or through community-driven projects that evolve year by year. We will likely see at least some serious GitHub repositories dedicated to WinRT growth over time.. But direct access to the Windows compositor would unlock real native UI rendering, low-level OS services, and system interactions and a TRUE access to core Windows technologies that are otherwise hidden behind the WinRT layer. that aren’t possible with FMX or VCL alone. Without this essential rendering layer, many critical Windows OS services and WinRT libraries remain difficult to access properly in Delphi. Features like deep integration with the Windows Input System, system-level animations, true windowing effects (Acrylic, Mica, Shader effects), media and graphics pipelines, and power-efficient rendering, Devices, Security, Management and more are all tied indirectly to the modern Windows compositor Features. The absence of a direct wrapper means developers must rely on workarounds or limited interoperability with COM-based WinRT APIs, making these essential system features harder to implement and maintain. FMX can't fully replicate a true Windows OS experience, especially with deeper WinRT integration. WinUI isn’t just about the UI—it connects directly to the Windows compositor|system services in ways FMX doesn’t. A proper wrapper for Windows.UI.Composition and Microsoft.UI.Composition would give developers more native power while keeping things efficient. Additionally, clear documentation and practical examples—such as how to initialize a composition surface, interact with system Features, or leverage deeper OS services—would make these capabilities far more accessible to Delphi developers. In the end, I am not an expert in Windows programming, and some of my information may be incomplete or inaccurate. However, there is no shame in expressing my opinion, even if only on a superficial level. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
Embarcadero has always focused on making complex APIs easier to use, so adding WinUI support seems like the natural next step. The longer they wait, the more chances they miss to keep Delphi as a top choice for Windows development. The main subject is going to disappear. So the big question is—will we see WinUI in the next RAD Studio version? Hopefully! 🚀 Thank you all, and please don’t criticize this reply as AI-generated too! 😄 -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
First and foremost, let me start by expressing my deep respect, admiration, and love for Ms. Dalija's response. She is well aware of how much I appreciate and respect her, as I have for many years. However, please do not take my response personally or interpret it as an attack against you. Despite my utmost respect for you, I firmly stand by my principles, and I am always ready to stand against the whole world if necessary to speak the truth, and I am proud of that. Now, my response this time might be very harsh, but since it touches on a very sensitive topic, I will not hesitate to defend it with full determination! First: The Use of AI in My Responses The claim that my responses are AI-assisted does not bother me at all—on the contrary, I am extremely proud of this technology and hold it in the highest regard. AI is the only tool in our harsh world that has opened the doors of opportunity for people like me, who have limited resources, to keep up with modern technological advancements. I openly and proudly acknowledge that AI has provided me—and many others like me—with golden opportunities that we could have never even dreamed of! I repeat, I am proud that almost every aspect of my life is assisted by AI. What truly angers me and pushes me to respond harshly, especially on this particular topic, is the elitist mindset that some people have—trying to prevent others from using this technology. I am firmly and strictly opposed to anyone who stands against people's freedom to use AI or who spies on their private activities using third-party tools to "expose" them for using AI, as if that were somehow unfair. For example, I do not speak English fluently like you do, yet thanks to AI, I now have the ability—at the very least—to communicate with you as an equal. At the end of the day, AI does not generate my ideas from scratch—it simply refines, translates, and enhances them. What’s even more impressive is that it provides me with advice and polishes my words, compared to the raw, unfiltered thoughts that I write in this chat. Second: My Transparency and Honesty I take great pride in the fact that I have no problem with people knowing the reality of my life. I am an extremely straightforward person, and I prefer not to use my real photo on my profiles rather than pretending to be someone I’m not. Unlike many people who present a fake online persona that is completely different from their real-life selves, I choose to be completely transparent about who I am. Anyone who follows my posts (if they understand Arabic) will see this clearly. I have absolute confidence in showing my real self, both in the virtual world and in reality. It does not bother me in the slightest if people know that I use AI tools to express my ideas or write elegant code. So why is there so much negativity and unnecessary propaganda against people who use AI? Third: A Point About Programmers and AI Who can say whether I am typing these words with my feet or my mouth, while you type effortlessly with your golden fingers and closed eyes? Furthermore, one of the strangest fears I see among programmers is the idea that their employers might find out that they use AI for coding! I find this mindset absurd—especially when you see platforms like Stack Overflow banning AI-generated content for questions and answers! Fourth: The Issue of WinUI Libraries in RAD Studio Regarding the integration of WinUI libraries by Embarcadero, you stated that this is not the company’s responsibility but rather the job of advanced programmers and third-party developers. I completely disagree with this notion. WinUI interfaces are not like Android, where it makes sense for Delphi to rely on third-party JNI bridge units. Delphi does not include built-in Android UI components because the Delphi IDE itself can only be installed on Windows. In contrast, WinUI is part of the core Windows operating system—the only platform where Delphi is natively supported. This makes WinUI components a fundamental right for every Delphi programmer, and they should be available in the Standard component panel, just like other built-in Windows UI controls. Delphi itself was originally designed to wrap Windows components natively. Additionally, WinUI libraries have been around since 2012 with the release of Windows 8. Today, we are in 2025—how can we justify such a long delay with such an unconvincing excuse? More than 12 years have passed, yet no one has fully integrated WinUI into RAD Studio. Instead, we have poorly implemented Windows 10-style components that are so unconvincing that even hobbyist programmers would not take them seriously! It’s time to stop lying to ourselves and be honest—as a developer community, we have completely neglected this technology, either out of arrogance or overconfidence in the FireMonkey framework, treating it as a magical solution for all modernization challenges. However, there is absolutely no logical reason to avoid wrapping WinUI components in RAD Studio. The process is no longer complicated at all, especially considering the advanced state of Embarcadero’s bridging and API wrapping tools. At this point, the only thing missing is UI integration and component wrapping—a golden opportunity for both the Delphi community and Embarcadero itself. Final Thoughts: WinUI Integration Will Not Distract Embarcadero Integrating WinUI components will not take significant time away from Embarcadero’s core focus. The company has already implemented almost everything needed. At this stage, there are likely only one or two steps left, and completing them will not divert attention from other critical improvements, such as the compiler, debugger, language features, or IDE functionality. On the contrary, this addition will increase the development team’s focus on these areas rather than distract them. Thank you. the ChatGpt Chat Link here -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
Haha, no, but I do appreciate well-thought-out discussions about Delphi’s future. At the end of the day, it's all about exploring possibilities rather than dismissing them outright. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
🔍 Will GUI-Based Development Go Extinct? 🤔 Some argue that GUI-based development is fading away in favor of code-centric or terminal-driven development. However, the reality is quite different: GUI development is evolving, not disappearing. 🧐 Why GUI-Based Development Won't Disappear? 1️⃣👨💻 Humans Prefer Productivity and Speed People naturally gravitate towards tools that enhance efficiency and reduce complexity. Development environments like Delphi and RAD Studio provide rapid application development, a demand that won't fade away anytime soon. Even with AI-powered coding assistants, GUI tools remain a time-saving necessity in many domains. Most developers prefer being productive rather than just looking like hackers typing endlessly in a green-on-black terminal. Writing code should be about building real solutions efficiently, not about proving how much you can type without a mouse! 2️⃣ 🚀 AI Is Enhancing GUI-Based Development, Not Replacing It AI-powered tools like GitHub Copilot, JetBrains AI, and AI-driven refactoring are deeply integrated into GUI-based IDEs. Delphi, C#/.NET, and Python IDEs now leverage AI to accelerate development, proving that GUI-based environments remain essential. 3️⃣ 🏢 Businesses Need Ready-to-Use Tools, Not Just Code In the real world, businesses prioritize rapid, efficient software development. Companies aren’t interested in reinventing the wheel—hence, RAD (Rapid Application Development) environments remain highly relevant. Delphi, C#/.NET, and even Java-based UI frameworks continue to play a critical role in enterprise solutions. 4️⃣ 🛠️ Clean Code and GUI Development Are Not Mutually Exclusive Some mistakenly believe that GUI development leads to messy, unstructured code, which is far from true. Modern Delphi supports clean architecture, OOP principles, design patterns (MVVM, MVP, SOLID), and well-structured projects. Many Delphi projects today adhere to clean coding practices just as rigorously as C# or Java applications. ----------- 🔹 The False Comparison Between Delphi and VB ✅ Delphi is NOT just another "Visual Basic"—it is a professional-grade development environment that offers: Full-fledged OOP (Object-Oriented Programming) support. Robust architectural patterns (MVVM, Layered Architecture, SOLID, Dependency Injection). Comprehensive libraries like FireMonkey and VCL for cross-platform and native development. Seamless integration with Windows APIs and modern OS features. ❌ On the other hand, VB had fundamental limitations in its OOP and architectural capabilities. 📌 Comparing Delphi to VB is completely inaccurate and misleading. 🟢 Delphi Is Continuously Evolving ✅ Delphi Has Strong OOP and Architectural Support Delphi has long evolved beyond just "drag-and-drop" development. It supports Dependency Injection, Unit Testing, and scalable architectures. ✅ Seamless Integration with Windows APIs, Including WinRT While Embarcadero has not natively included full WinUI support, they have provided highly professional WinRT integration using TWinRTGenericImport. This approach is similar to their work on Android libraries, offering a clean and efficient way to interact with WinRT. ✅ The Delphi Community Is More Active Than Ever GitHub repositories, Stack Overflow discussions, and Delphi-focused YouTube content demonstrate the language’s ongoing evolution. Modern Delphi development embraces clean code, architectures, and high-quality patterns. ⚡ Final Thoughts: GUI Development Isn't Dying—It's Evolving! ❌ The claim that GUI-based development is disappearing is an oversimplification. ✅ In reality, tools like Delphi are thriving because they adapt to modern development needs. ✅ Delphi is no longer just about drag-and-drop—it supports advanced architectures, OOP, and scalable patterns. ✅ The competition with C#, Java, and C++ does not mean Delphi is obsolete—on the contrary, it's gaining new strengths. 💡 However, if there’s one thing I can guarantee will go extinct, it’s not Delphi itself, but the era of classic, messy "spaghetti code" development. 🚀 Most modern Delphi developers no longer even have the patience or willingness to open old, disorganized projects because of their lack of structure, logic, and maintainability. 🔥 Clean, well-architected code is the new standard—and that’s where Delphi is heading! 🔥 Delphi will remain a powerhouse as long as it continues to adapt and evolve! 🚀 -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
Bold ideas deserve bold formatting... If the argument is strong, the formatting shouldn't matter, Formatting aside, do you have any thoughts on the actual argument? or should i switch to italics next time !!—just for variety😉 -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
I completely disagree with your statement. You have oversimplified and diminished the significance of WinRT & WinUI by reducing them to mere "UI design," which is a common but outdated misconception. The reality is very different—those who can seamlessly and efficiently leverage these system libraries are the true masters of desktop programming, whether people like it or not. Let’s be honest with ourselves: by relying entirely on FireMonkey as a one-size-fits-all solution, we are pushing ourselves toward obsolescence. If we keep treating FireMonkey like some kind of ultimate tool or a magical fix for everything, we will soon find ourselves irrelevant in the world of professional software development. Desktop Development is More Than Just Beautiful UI Building desktop applications isn’t just about fancy interfaces—it requires deep system-level control. The real power of WinRT & WinUI lies in their tight integration with the Windows ecosystem, offering native system services, APIs, and deep OS interactions that simply cannot be replicated by a cross-platform framework like FireMonkey. I challenge anyone to effortlessly call and manage WinRT services using Delphi’s built-in bindings and interop features without hitting major roadblocks. If you think WinUI is just about UI aesthetics, you are missing the bigger picture. The False "Lack of Demand" Argument Another common misconception is that there is no demand for native system libraries from customers or major software vendors like Embarcadero. This argument is flawed because how can developers reject something they haven’t even had the chance to experience? It makes no sense to assume that programmers wouldn’t want direct access to powerful, built-in Windows features without relying on third-party libraries. The Real Reason Behind Delphi's Lack of Focus on WinRT & WinUI The truth is, third-party component vendors have a vested interest in keeping Embarcadero away from fully embracing native Windows APIs. Why? Because if Delphi had first-class support for WinRT & WinUI, developers wouldn’t need to buy so many external, expensive third-party components to achieve what should be standard functionality in a professional development environment. Final Thoughts If Delphi continues to ignore the power of native Windows development in favor of an all-in-one cross-platform approach, it will gradually lose its place in the desktop programming world. True desktop developers need full control over the operating system—not just a nice-looking UI. It’s time we stop fooling ourselves and start recognizing the real value of native system libraries before it’s too late. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
You keep shifting the goalposts. First, it was 'no third-party support,' then it became 'no third-party libraries,' then 'no proof of demand,' and finally, a critique of Embarcadero. WinUI 3 may not be mainstream, but dismissing it entirely while ignoring its capabilities is shortsighted. The real issue isn't whether WinUI 3 is 'dead'—it's that Delphi developers are often late to adopt modern Windows technologies, which only widens the gap. If you truly believe Delphi lags behind, maybe it's because of this very mindset. Instead of dismissing everything outright, we should be pushing for better integration and innovation. Anyway, if you're done, that's fine. Some of us will keep exploring new tech instead of writing it off. Cheers. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
You're too fixated on the idea that WinUI 3 is 'dead.' Regardless of its status, we need to catch up after our long absence from modern UI development. Whether WinUI 3 is thriving or struggling, the fact remains: it's a framework that allows for modern, sleek UI, smooth animations, and seamless access to WinRT APIs. Can you achieve the same level of design and fluidity as others using only native Windows libraries? Right now, we don’t even have proper documentation on how to use bindings for WinRT. It pains me to browse GitHub and see people with other Programming languages building stunning applications using nothing but Windows libraries, while in the Pascal section, searching for anything related to WinRT feels like a joke!!. Even if we classified HTML as a programming language, it would still have better access to advanced WinRT libraries than what we currently have in Pascal. That alone should tell you something... Clipper or else .. Since Delphi community still focus on bad ideas like WinUI is DOA !! ------------- Clipper or else…? That’s an interesting comparison. Meanwhile, other developer communities are pushing forward, integrating modern Windows APIs, and making the most of what’s available. If the Delphi community keeps clinging to outdated ideas—like insisting WinUI 3 is DOA instead of actually exploring its capabilities—we’ll just keep falling further behind. Whether WinUI 3 thrives or not, at least others are building modern UI, leveraging WinRT with ease, and creating stunning applications. Meanwhile, we're still debating if we should even try. That’s the real issue. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
The fact that Microsoft includes Delphi and Java as third-party tech in official XAML Islands documentation shows that they acknowledge these technologies in modern Windows UI development. If WinUI 3 had 'no third-party support,' Microsoft wouldn't even bother addressing interoperability at all !!. XAML Islands and WinUI 3 are different, but both serve to integrate modern Windows UI with existing technologies. If anything, XAML Islands proves there's demand for bridging WinUI with third-party tools like Delphi."* -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
"If WinUI 3 has 'no 3rd party support,' why does Microsoft itself list Delphi and Java as third-party technologies in their official documentation? GitHub link: Microsoft Windows-AppConsult-XAMLIslandsLab Seems like Microsoft disagrees with your claim. Move on. 😉" -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
bravesofts replied to bravesofts's topic in Windows API
That's a valid concern, and I agree that Microsoft's UI strategy has been quite fragmented over the years. However, while WinUI 3 may not have gained the traction Microsoft initially hoped for, it is still the underlying UI framework for Windows App SDK. Many of Microsoft's own apps, like the new Windows Settings app, use WinUI. Even if WinUI 3 itself doesn’t evolve into the dominant framework, its components and architecture are still part of the modern Windows development ecosystem. Also, XAML Islands are still actively maintained, allowing WinUI 3 controls to be embedded into existing Win32/VCL apps. This presents a great opportunity for RAD Studio to bridge the gap rather than requiring developers to migrate to Microsoft's inconsistent ecosystem. Regarding the lack of a GUI designer—yes, it's a drawback, but that’s exactly where Embarcadero could step in. RAD Studio has always excelled in visual design, and integrating WinUI 3 with Delphi’s existing design-time capabilities could provide a much better experience than Microsoft’s current tools. Even if WinUI 3 fades, the demand for modern, fluid UI in Windows applications won’t disappear. The question is: Will Embarcadero seize the opportunity to offer an elegant solution for Delphi developers? -
I want to implement a variadic method in Delphi that behaves like Write and Writeln, where I can pass a variable number of arguments directly, without using brackets ([]) around the arguments. For example, instead of calling a method like this: MyWriteln(['Hello', 123, 45.67]); // Using array of const with brackets I want to call it like this: MyWriteln('Hello', 123, 45.67); // Without brackets, similar to Writeln I found that Delphi supports varargs for external DLL functions declared with cdecl, like this: procedure Test(aArgs: array of const); varargs; cdecl; external 'externalLibrary.dll'; However, since this approach is limited to external functions, I’d like to know if there’s any way to implement a similar variadic method directly in Delphi, avoiding the need for brackets around the arguments. My main questions are: How can I implement a Delphi variadic method that allows calling it without brackets, similar to Write/Writeln? If it's only possible using varargs with external DLLs, how would I correctly declare and call such a method? Any help or examples would be greatly appreciated! ----- I’m working on a Delphi console application where I want to redirect the standard Write and Writeln output to a synchronized memo viewer in a separate VCL application. Here's a simplified version of my current setup: unit Console.Output.MemoViewer; interface uses Winapi.Windows, System.SysUtils, System.Classes, System.SyncObjs, System.RTTI, System.Generics.Collections; type TOutputViewer = class private fVCLAppPath: string; fStartupInfo: TStartupInfo; fProcessInfo: TProcessInformation; fLogFileName: string; fLogFileStream: TFileStream; fStreamWriter: TStreamWriter; fFileLock: TCriticalSection; procedure SetFileHiddenAttribute(const aFilePath: string); procedure ExtractVCLApp(const aResourceName: string; const aOutputPath: string); procedure LaunchVCLApp; procedure WaitForVCLAppClose; procedure WriteOutput(const aText: string); public constructor Create; destructor Destroy; override; procedure mWriteln(const aArgs: array of const); procedure HandleConsoleClose; stdcall; end; implementation { TOutputViewer } constructor TOutputViewer.Create; begin fVCLAppPath := ExtractFilePath(ParamStr(0)) + 'MemoViewer.exe'; fLogFileName := 'ConsoleOutput.log'; fFileLock := TCriticalSection.Create; // Extract and launch the VCL app ExtractVCLApp('MEMOVIEWER', fVCLAppPath); LaunchVCLApp; // Initialize the log file for writing output fLogFileStream := TFileStream.Create(fLogFileName, fmCreate or fmShareDenyNone); fStreamWriter := TStreamWriter.Create(fLogFileStream, TEncoding.UTF8); end; destructor TOutputViewer.Destroy; begin fFileLock.Acquire; try FreeAndNil(fStreamWriter); FreeAndNil(fLogFileStream); finally fFileLock.Release; FreeAndNil(fFileLock); end; // Wait for VCL app to close and clean up WaitForVCLAppClose; inherited; end; procedure TOutputViewer.SetFileHiddenAttribute(const aFilePath: string); var LFileAttr: DWORD; begin LFileAttr := GetFileAttributes(PChar(aFilePath)); if LFileAttr <> INVALID_FILE_ATTRIBUTES then SetFileAttributes(PChar(aFilePath), LFileAttr or FILE_ATTRIBUTE_HIDDEN); end; procedure TOutputViewer.ExtractVCLApp(const aResourceName: string; const aOutputPath: string); var LResourceStream: TResourceStream; LFileStream: TFileStream; begin if not FileExists(aOutputPath) then begin LResourceStream := TResourceStream.Create(HInstance, aResourceName, RT_RCDATA); try LFileStream := TFileStream.Create(aOutputPath, fmCreate); try LFileStream.CopyFrom(LResourceStream, LResourceStream.Size); finally LFileStream.Free; end; finally LResourceStream.Free; end; SetFileHiddenAttribute(aOutputPath); end; end; procedure TOutputViewer.LaunchVCLApp; begin ZeroMemory(@fStartupInfo, SizeOf(fStartupInfo)); fStartupInfo.cb := SizeOf(fStartupInfo); if not CreateProcess(nil, PChar(fVCLAppPath), nil, nil, False, 0, nil, nil, fStartupInfo, fProcessInfo) then RaiseLastOSError; end; procedure TOutputViewer.WaitForVCLAppClose; begin WaitForSingleObject(fProcessInfo.hProcess, INFINITE); CloseHandle(fProcessInfo.hProcess); CloseHandle(fProcessInfo.hThread); if FileExists(fVCLAppPath) then DeleteFile(PChar(fVCLAppPath)); end; procedure TOutputViewer.WriteOutput(const aText: string); begin fFileLock.Acquire; try fStreamWriter.WriteLine(aText); fStreamWriter.Flush; finally fFileLock.Release; end; end; function VarRecToStr(const V: TVarRec): string; begin case V.VType of vtInteger: Result := IntToStr(V.VInteger); vtBoolean: Result := BoolToStr(V.VBoolean, True); vtChar: Result := V.VChar; vtString: Result := string(V.VString^); vtAnsiString: Result := string(AnsiString(V.VAnsiString)); vtWideString: Result := WideString(V.VWideString); vtUnicodeString: Result := string(UnicodeString(V.VUnicodeString)); vtInt64: Result := IntToStr(V.VInt64^); else Result := '[Unknown]'; end; end; procedure TOutputViewer.mWriteln(const aArgs: array of const); var LText: string; LArg: TVarRec; begin LText := ''; for LArg in aArgs do LText := LText + Format('%s', [VarRecToStr(LArg)]) + ' '; WriteOutput(LText.Trim); writeln(LText.Trim); end; procedure TOutputViewer.HandleConsoleClose; stdcall; begin TerminateProcess(fProcessInfo.hProcess, 0); WaitForVCLAppClose; Halt(0); end; end. program ConsoleMemoViewer; {$APPTYPE CONSOLE} uses SysUtils, Console.Output.MemoViewer in 'API\Console.Output.MemoViewer.pas'; var Viewer: TOutputViewer; begin try Viewer := TOutputViewer.Create; with Viewer do try mWriteln('Hello from redirected Writeln!:', 22, 35.7); mWriteln('This line uses redirected Write:', 22, ', Test 2: ', 35.7); mWriteln('Foo String: ', 22, ', Test 2: ', 35.7, 'Foo string:', 3333); finally Viewer.Free; end; except on E: Exception do Writeln('Error: ', E.Message); end; end. Currently, I'm using an array of const approach for mWriteln, but that requires enclosing the arguments in brackets, like this: mWriteln(['Hello', 123, 45.67]); // Requires brackets I’m aware of the overload solution where multiple versions of mWriteln can be created for different argument counts, but this is not practical when dealing with a large or unknown number of arguments.
-
🔥 Who can accurately recreate this UI in Delphi VCL? 🔥 ---- 👉 Rules of the challenge: No third-party components – Only pure VCL! Windows API calls only – No hacks like setting a blurred wallpaper. True glass blur effect – The UI must feature real-time Gaussian Blur, not a fake overlay. Resizable & smooth movement – The form should be fully resizable and draggable without lag. Performance separation – The blur effect must run on a separate thread, ensuring that UI interactions stay smooth. Native Windows 11 style – The form should have real rounded corners, using the native Windows 11 API. Update on the challenge requirements: Regarding Resizing, and even Moving, the developer may revert the form’s design to be Normal in terms of background and borders (to make it easier for everyone to participate and to minimize code for smoother application performance). Regarding updating the background when the form does not move, you are also not required to provide this background capture (meaning we want everyone to participate, thank you). --- Happy birthday and a new year for Delphi—and every year, becomes stronger and better... --- 🚀 Fun fact: The login form shown in the image is actually running on Windows XP! 🤯 💬 Can you achieve this in Delphi VCL? Post your best attempt below! 👇 ----
-
unit Main.View; interface uses {$REGION ' Defaults Units .. '} Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Buttons, Vcl.StdCtrls, {$ENDREGION} // System.Types; type TMainView = class(TForm) Lbl1: TLabel; Btn1: TButton; Pnl1: TPanel; Pnl2: TPanel; Btn2: TButton; Lbl2: TLabel; Btn3: TSpeedButton; BtnCapture: TButton; ImgCapturedCtrl: TImage; CmboBox_Ctrls: TComboBox; procedure FormCreate(Sender: TObject); procedure BtnCaptureClick(Sender: TObject); private function CaptureControl(aControl: TControl): TBitmap; inline; public { Public declarations } end; var MainView: TMainView; implementation {$R *.dfm} function TMainView.CaptureControl(aControl: TControl): TBitmap; var LDC: HDC; LRect: TRect; LCtrlHwnd: THandle; LOffset: TPoint; begin Result := TBitmap.Create; try LRect := aControl.BoundsRect; Result.SetSize(LRect.Width, LRect.Height); Result.Canvas.Brush.Color := clWhite; Result.Canvas.FillRect(Rect(0, 0, LRect.Width, LRect.Height)); Result.Canvas.Lock; try if aControl is TWinControl then begin LCtrlHwnd := TWinControl(aControl).Handle; LOffset := Point(0, 0); // No offset needed for TWinControl end else begin LCtrlHwnd := TWinControl(aControl.Parent).Handle; LOffset := aControl.BoundsRect.TopLeft; // Convert to parent-relative coordinates end; LDC := GetDC(LCtrlHwnd); try BitBlt(Result.Canvas.Handle, 0, 0, LRect.Width, LRect.Height, LDC, LOffset.X, LOffset.Y, SRCCOPY); finally ReleaseDC(LCtrlHwnd, LDC); end; finally Result.Canvas.Unlock; end; except Result.Free; raise; end; end; procedure TMainView.FormCreate(Sender: TObject); var I: Integer; begin CmboBox_Ctrls.Items.Clear; for I := 0 to Self.ComponentCount - 1 do if Self.Components[I] is TControl then CmboBox_Ctrls.Items.Add(Self.Components[I].Name); CmboBox_Ctrls.ItemIndex := 0; end; procedure TMainView.BtnCaptureClick(Sender: TObject); var LCtrl: TControl; LBmp: TBitmap; begin if CmboBox_Ctrls.ItemIndex <> -1 then begin LCtrl := FindComponent(CmboBox_Ctrls.Text) as TControl; if Assigned(LCtrl) then begin LBmp := CaptureControl(LCtrl); try ImgCapturedCtrl.Picture.Assign(LBmp); finally LBmp.Free; end; end; end; end; end. Dfm object MainView: TMainView Left = 0 Top = 0 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'MainView' ClientHeight = 297 ClientWidth = 705 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -18 Font.Name = 'Segoe UI' Font.Style = [] OnCreate = FormCreate PixelsPerInch = 144 TextHeight = 25 object Lbl1: TLabel Left = 417 Top = 33 Width = 33 Height = 25 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Lbl1' end object ImgCapturedCtrl: TImage Left = 18 Top = 117 Width = 304 Height = 176 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 end object Btn1: TButton Left = 558 Top = 18 Width = 125 Height = 47 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Btn1' TabOrder = 0 end object Pnl1: TPanel Left = 402 Top = 202 Width = 281 Height = 68 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Pnl1' TabOrder = 1 end object Pnl2: TPanel Left = 402 Top = 90 Width = 281 Height = 107 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Pnl2' TabOrder = 2 object Lbl2: TLabel Left = 174 Top = 27 Width = 33 Height = 25 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Lbl2' end object Btn3: TSpeedButton Left = 150 Top = 69 Width = 118 Height = 33 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 end object Btn2: TButton Left = 15 Top = 27 Width = 113 Height = 38 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Btn2' TabOrder = 0 end end object BtnCapture: TButton Left = 18 Top = 21 Width = 304 Height = 50 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 Caption = 'Get Control Capture' TabOrder = 3 OnClick = BtnCaptureClick end object CmboBox_Ctrls: TComboBox Left = 18 Top = 81 Width = 304 Height = 33 Margins.Left = 5 Margins.Top = 5 Margins.Right = 5 Margins.Bottom = 5 TabOrder = 4 Text = 'CmboBox_Ctrls' end end good luck..
-
Of course, yes! It's your hard work and dedication here, and you absolutely deserve not only a license but lifelong respect for your efforts! 🔥🚀
-
Windows Composition API Is Still WinAPI ? Even though it’s sometimes called the “composition API,” functions like SetWindowCompositionAttribute or DwmSetWindowAttribute are exported from system DLLs (e.g., user32.dll or dwmapi.dll) and thus part of the Windows API. On Windows 11, you can apply Acrylic (DWMSBT_ACRYLIC) or Mica (DWMSBT_MAINWINDOW) to a window without a custom GPU pipeline, and it’s still hardware-accelerated by DWM behind the scenes. Delphi Borderless Form Native Windows 11 Rounded Corners You can request real rounded corners via the Windows 11 API
-
Sorry for that. TStyleManager uses custom resizing instead of the native Windows border, meaning the window won't have a native border & shadow when resizing. The form should be fully resizable and draggable without lag. -- To help you move forward, try this technique first: Delphi Borderless Form This is a good starting point. Regarding rounded corners, the challenge primarily targets Windows 11, but support for older versions down to XP is still important. -- For the glass blur effect, you should use the provided Windows API. Otherwise, if you implement your own workaround, the blur effect must run on a separate thread to ensure UI interactions remain smooth. -- Third-party components are not allowed. The window resizing and movement must be smoothly updated without high CPU usage. The app should run as fast and responsively as possible. --- Thank you for your interest! 😊
-
You have earned an abundance of love and respect over the years, especially through your outstanding contributions to UI design. I know you can do it—haha, you've already proven yourself time and time again!
-
You have earned an abundance of love and respect over the years, especially through your outstanding contributions to UI design. I know you can do it—haha, you've already proven yourself time and time again!
-
The Challenge Requirement has been updated. 😊🚀🔥
-
in fact your reply is correct, BUT MY VCL WINDOW STILL DO THE SAME !!
-
No, the background is not a static image. The form background is dynamically captured in real-time, just like a real glass window. It continuously updates to reflect any changes happening behind the form, creating a true transparent and blurred glass effect. 🚀
-
unit API.Utils; interface uses System.SysUtils, System.Types, System.Generics.Defaults; type TRange<T> = class public // Check if a value is within the range [aMin, aMax] using a custom comparer class function IsIn(const aValue, aMin, aMax: T; const aComparer: IComparer<T>): Boolean; overload; static; // Check if a value is within the range [aMin, aMax] using the default comparer class function IsIn(const aValue, aMin, aMax: T): Boolean; overload; static; end; implementation { TRange<T> } class function TRange<T>.IsIn(const aValue, aMin, aMax: T; const aComparer: IComparer<T>): Boolean; begin Result := (aComparer.Compare(aValue, aMin) >= 0) and (aComparer.Compare(aValue, aMax) <= 0); end; class function TRange<T>.IsIn(const aValue, aMin, aMax: T): Boolean; begin Result := IsIn(aValue, aMin, aMax, TComparer<T>.Default); end; end. to put this Super class in test i build a new console project: this unit here act as my objects: unit API.Objects.Comparer; interface uses System.Types, System.Generics.Defaults; type ICustomRecord = interface; // Forward ICustomRecordUpdate = interface function Edit(const aName: string; const aValue: Integer): ICustomRecord; end; ICustomRecord = interface function GetName: string; function GetValue: Integer; function GetCustomRecordUpdate: ICustomRecordUpdate; property Name: string read GetName; property Value: Integer read GetValue; property New: ICustomRecordUpdate read GetCustomRecordUpdate; end; IProduct = interface; // Forward IProductUpdate = interface function Edit(const aID: Integer; const aPrice: Currency): IProduct; end; IProduct = interface function GetID: Integer; function GetPrice: Currency; function GetIProductUpdate: IProductUpdate; property ID: Integer read GetID; property Price: Currency read GetPrice; property New: IProductUpdate read GetIProductUpdate; end; IClient = interface; // Forward IClientUpdate = interface function Edit(const aName: string; const aAge: Integer): IClient; end; IClient = interface function GetName: string; function GetAge: Integer; function GetIClientUpdate: IClientUpdate; property Name: string read GetName; property Age: Integer read GetAge; property New: IClientUpdate read GetIClientUpdate; end; // Compare Custom Records <Helper function> function CompareCustomRecord(const R1, R2: ICustomRecord): Integer; // Compare Products by thier Prices <Helper function> function CompareProductByPrice(const P1, P2: IProduct): Integer; // Compare Clients by thier Ages <Helper function> function CompareClientByAge(const C1, C2: IClient): Integer; // points comparison <Helper functions> function ComparePoints(const P1, P2: TPoint): Integer; overload; function ComparePoints(const P1, P2: TPointF): Integer; overload; // Returns a custom comparer for TPoint function PointComparer: IComparer<TPoint>; function GetTCustomRecord(const aName: string; aValue: Integer): ICustomRecord; function GetTProduct(aID: Integer; aPrice: Currency): IProduct; function GetTClient(const aName: string; aAge: Integer): IClient; implementation uses System.Math; type TCustomRecord = class(TInterfacedObject, ICustomRecord, ICustomRecordUpdate) strict private fName: string; fValue: Integer; function GetName: string; function GetValue: Integer; function GetCustomRecordupdate: ICustomRecordUpdate; function Edit(const aName: string; const aValue: Integer): ICustomRecord; public constructor Create(const aName: string; aValue: Integer); end; TProduct = class(TInterfacedObject, IProduct, IProductUpdate) private fID: Integer; fPrice: Currency; function GetID: Integer; function GetPrice: Currency; function GetIProductUpdate: IProductUpdate; function Edit(const aID: Integer; const aPrice: Currency): IProduct; public constructor Create(aID: Integer; aPrice: Currency); end; TClient = class(TInterfacedObject, IClient, IClientUpdate) private fName: string; fAge: Integer; function GetName: string; function GetAge: Integer; function GetIClientUpdate: IClientUpdate; function Edit(const aName: string; const aAge: Integer): IClient; public constructor Create(const aName: string; aAge: Integer); end; function GetTCustomRecord(const aName: string; aValue: Integer): ICustomRecord; begin Result := TCustomRecord.Create(aName, aValue); end; function GetTProduct(aID: Integer; aPrice: Currency): IProduct; begin Result := TProduct.Create(aID, aPrice); end; function GetTClient(const aName: string; aAge: Integer): IClient; begin Result := TClient.Create(aName, aAge); end; {$REGION ' Points Comparer & Helper Functions .. '} function ComparePoints(const P1, P2: TPoint): Integer; begin if P1.X < P2.X then Exit(-1) else if P1.X > P2.X then Exit(1); if P1.Y < P2.Y then Exit(-1) else if P1.Y > P2.Y then Exit(1); Result := 0; // Points are equal end; function ComparePoints(const P1, P2: TPointF): Integer; begin if P1.X <> P2.X then Result := Sign(P1.X - P2.X) else Result := Sign(P1.Y - P2.Y); end; function PointComparer: IComparer<TPoint>; begin Result := TComparer<TPoint>.Construct( function(const P1, P2: TPoint): Integer begin Result := ComparePoints(P1, P2); end ); end; {$ENDREGION} { Helper CustomRecord function } function CompareCustomRecord(const R1, R2: ICustomRecord): Integer; begin Result := R1.Value - R2.Value; end; { Helper ProductByPrice function } function CompareProductByPrice(const P1, P2: IProduct): Integer; begin if P1.Price < P2.Price then Result := -1 else if P1.Price > P2.Price then Result := 1 else Result := 0; end; { Helper ClientByAge function } function CompareClientByAge(const C1, C2: IClient): Integer; begin Result := C1.Age - C2.Age; end; { TCustomRecord } {$REGION ' TCustomRecord .. '} constructor TCustomRecord.Create(const aName: string; aValue: Integer); begin fName := aName; fValue := aValue; end; function TCustomRecord.GetName: string; begin Result := fName; end; function TCustomRecord.GetValue: Integer; begin Result := fValue; end; function TCustomRecord.GetCustomRecordupdate: ICustomRecordUpdate; begin Result := Self as ICustomRecordUpdate; end; function TCustomRecord.Edit(const aName: string; const aValue: Integer): ICustomRecord; begin fName := aName; fValue := aValue; end; {$ENDREGION} { TProduct } {$REGION ' TProduct .. '} constructor TProduct.Create(aID: Integer; aPrice: Currency); begin fID := aID; fPrice := aPrice; end; function TProduct.GetID: Integer; begin Result := fID; end; function TProduct.GetPrice: Currency; begin Result := fPrice; end; function TProduct.GetIProductUpdate: IProductUpdate; begin Result := Self as IProductUpdate; end; function TProduct.Edit(const aID: Integer; const aPrice: Currency): IProduct; begin fID := aID; fPrice := aPrice; end; {$ENDREGION} { TClient } {$REGION ' TClient .. '} constructor TClient.Create(const aName: string; aAge: Integer); begin fName := aName; fAge := aAge; end; function TClient.GetName: string; begin Result := fName; end; function TClient.GetAge: Integer; begin Result := fAge; end; function TClient.GetIClientUpdate: IClientUpdate; begin Result := Self as IClientUpdate; end; function TClient.Edit(const aName: string; const aAge: Integer): IClient; begin fName := aName; fAge := aAge; end; {$ENDREGION} end. now here is my dpr console code: program RangChecker; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Types, DateUtils, System.Generics.Defaults, API.Utils in 'API\API.Utils.pas', API.Objects.Comparer in 'API\API.Objects.Comparer.pas'; var gPoint1, gPoint2, gPoint3: TPoint; gRec1, gRec2, gRec3: ICustomRecord; gRecordComparer: IComparer<ICustomRecord>; gProduct1, gProduct2, gProduct3: IProduct; gProductComparer: IComparer<IProduct>; gClient1, gClient2, gClient3: IClient; gClientComparer: IComparer<IClient>; gEndDateStr: string; begin gPoint1 := TPoint.Create(1, 2); gPoint2 := TPoint.Create(0, 0); gPoint3 := TPoint.Create(3, 4); gRec1 := GetTCustomRecord('Low', 10); gRec2 := GetTCustomRecord('Mid', 20); gRec3 := GetTCustomRecord('High', 30); gRecordComparer := TComparer<ICustomRecord>.Construct(CompareCustomRecord); gProduct1 := GetTProduct(1, 10.0); gProduct2 := GetTProduct(2, 20.0); gProduct3 := GetTProduct(3, 30.0); gProductComparer := TComparer<IProduct>.Construct(CompareProductByPrice); gClient1 := GetTClient('Alice', 25); gClient2 := GetTClient('Bob', 30); gClient3 := GetTClient('Charlie', 35); gClientComparer := TComparer<IClient>.Construct(CompareClientByAge); with FormatSettings do begin ShortDateFormat := 'DD MMMM YYYY'; CurrencyString := 'DA'; DecimalSeparator := ','; ThousandSeparator := '.'; end; gEndDateStr := DateToStr(Today +10, FormatSettings); try Writeln('-----------------<< Integer Tests >>--------------------------------'); {$REGION ' Integer Tests .. '} if TRange<Integer>.IsIn(5, 1, 10) then Writeln('5 is within the range [1, 10]') else Writeln('5 is outside the range [1, 10]'); if TRange<Integer>.IsIn(5, 6, 10) then Writeln('5 is within the range [6, 10]') else Writeln('5 is outside the range [6, 10]'); {$ENDREGION} Writeln('-----------------<< Int64 Tests >>--------------------------------'); {$REGION ' Int64 Tests .. '} if TRange<Int64>.IsIn(5_000_000_000_000_000_001, 5_000_000_000_000_000_000, 5_000_000_000_000_000_010) then Writeln('5_000_000_000_000_000_001 is within the range [5_000_000_000_000_000_000, 5_000_000_000_000_000_010]') else Writeln('5 is outside the range [5_000_000_000_000_000_000, 5_000_000_000_000_000_010]'); if TRange<Int64>.IsIn(5_000_000_000_000_000_000, 5_000_000_000_000_000_001, 5_000_000_000_000_000_010) then Writeln('5_000_000_000_000_000_000 is within the range [5_000_000_000_000_000_001, 5_000_000_000_000_000_010]') else Writeln('5_000_000_000_000_000_000 is outside the range [5_000_000_000_000_000_001, 5_000_000_000_000_000_010]'); {$ENDREGION} Writeln('-----------------<< Float Tests >>----------------------------------'); {$REGION ' Float Tests .. '} if TRange<Double>.IsIn(7.5, 5.0, 10.0) then Writeln('7.5 is within the range [5.0, 10.0]') else Writeln('7.5 is outside the range [5.0, 10.0]'); if TRange<Double>.IsIn(7.5, 7.6, 10.0) then Writeln('7.5 is within the range [7.6, 10.0]') else Writeln('7.5 is outside the range [7.6, 10.0]'); {$ENDREGION} Writeln('-----------------<< DateTime Tests >>------------------------------'); {$REGION ' DateTime Tests .. '} if TRange<TDateTime>.IsIn(Today, Today, Today +10) then Writeln('Today is within ['+Today.ToString+'] and ['+gEndDateStr+']') else Writeln('Today is outside ['+Today.ToString+'] and ['+gEndDateStr+']'); if TRange<TDateTime>.IsIn(Yesterday, Today, Today +10) then Writeln('Yesterday is within ['+Today.ToString+'] and ['+gEndDateStr+']') else Writeln('Yesterday is outside ['+Today.ToString+'] and ['+gEndDateStr+']'); {$ENDREGION} Writeln('-----------------<< String Tests >>--------------------------------'); {$REGION ' String Tests .. '} if TRange<string>.IsIn('hello', 'alpha', 'zulu') then Writeln('"hello" is within the range [alpha, zulu]') else Writeln('"hello" is outside the range [alpha, zulu]'); if TRange<string>.IsIn('zulu', 'alpha', 'omega') then Writeln('"zulu" is within the range [alpha, omega]') else Writeln('"zulu" is outside the range [alpha, omega]'); {$ENDREGION} Writeln('-----------------<< TPoint Tests >>-----------------------------'); {$REGION ' TPoint Tests .. '} if TRange<TPoint>.IsIn(gPoint1, gPoint2, gPoint3, PointComparer) then Writeln('Point(1, 2) is within the range [Point(0, 0), Point(3, 4)]') else Writeln('Point(1, 2) is outside the range [Point(0, 0), Point(3, 4)]'); if TRange<TPoint>.IsIn(Point(5, 5), Point(0, 0), Point(3, 4), PointComparer) then Writeln('Point(5, 5) is within the range [Point(0, 0), Point(3, 4)]') else Writeln('Point(5, 5) is outside the range [Point(0, 0), Point(3, 4)]'); {$ENDREGION} Writeln('-----------------<< TCustomRecord Tests >>-----------------------------'); {$REGION ' TCustomRecord Tests .. '} if TRange<ICustomRecord>.IsIn(gRec2, gRec1, gRec3, gRecordComparer) then Writeln('Record is within the range') else Writeln('Record is outside the range'); gRec2.New.Edit('Mid', 40); if TRange<ICustomRecord>.IsIn(gRec2, gRec1, gRec3, gRecordComparer) then Writeln('Record is within the range') else Writeln('Record is outside the range'); {$ENDREGION} Writeln('-----------------<< TProduct Tests >>-----------------------------'); {$REGION ' TProduct Tests .. '} if TRange<IProduct>.IsIn(gProduct2, gProduct1, gProduct3, gProductComparer) then Writeln('Product price is within the range') else Writeln('Product price is outside the range'); gProduct2.New.Edit(2, 40); if TRange<IProduct>.IsIn(gProduct2, gProduct1, gProduct3, gProductComparer) then Writeln('Product price is within the range') else Writeln('Product price is outside the range'); {$ENDREGION} Writeln('-----------------<< TClient Tests >>-----------------------------'); {$REGION ' TClient Tests .. '} if TRange<IClient>.IsIn(gClient2, gClient1, gClient3, gClientComparer) then Writeln('Client age is within the range') else Writeln('Client age is outside the range'); gClient2.New.Edit('Bob', 40); if TRange<IClient>.IsIn(gClient2, gClient1, gClient3, gClientComparer) then Writeln('Client age is within the range') else Writeln('Client age is outside the range'); {$ENDREGION} except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. Output Result: My Github Link