Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/16/23 in all areas

  1. Since a multi-year project was canceled at short notice without any reason given, I have free capacities. - Modernization of programs, architecture design, frameworks, components etc. - Consulting, Training on the Job - Analysis & Code Reviews - >35 years of software development - Delphi 11.3 (since Delphi 1), C++ Builder - RemObjects, TMS ALL Access, DevExpress, Devart UniDac, TsiLang, Fast Report, Report Builder, CodeSite etc. - iOS App development (own architecture) I can also work on a daily or weekly basis or provide assistance via Teamviewer in urgent cases. I will send my profile on request: sw.architect@icloud.com Thank you, kind regards Michael Young
  2. vfbb

    Skia4Delphi

    Website: github.com/viniciusfbb/skia4delphi Skia4Delphi is a cross-platform 2D graphics API for Delphi based on Google's Skia Graphics Library (skia.org). Google's Skia Graphics Library serves as the graphics engine for Google Chrome and Chrome OS, Android, Flutter, Xamarin, Mozilla Firefox and Firefox OS, and many other products. Skia provides a more robust Canvas, being very fast and very stable, with hundreds of features for drawing 2D graphics, in addition to a text shaping engine designed to render texts in the most diverse languages with right-to-left support (such as the Persian language), full support for loading SVG files, support for creating PDF files, support for rendering Lottie files (verotized animations created in Adobe After Effects), integration with the GPU, among countless other cool features. Skia's idea is similar to Firemonkey's, the same codebase used in an OS will work the same on other platforms. It is also possible to design using the CPU in independent background threads. Skia also has native codecs, of course if you don't use the SKCodec class, when loading an encoded image it will give priority to using the platform's native codec, but it is possible to use its codec, for example for jpeg files it uses libjpeg-turbo and for png files libpng which maybe in certain environments may perform better than native. See some examples: Advanced shapes Advanced text rendering / shaping Svg Lottie files And much more...
  3. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma dont forget: you need verify if the file really exists and then some way block another app to change/delete...
  4. David Schwartz

    Can anyone spot the errors?

    Consider that the ordinal value of any specific character is given by the position of the character in the ASCII table, which is why I posted a link to it. Seems the OP didn't even notice it. Instead, we ended up with a senseless debate about ordinal values of characters versus strings. smh. According to the ASCII table, the ordinal (decimal) value of the character '0' (zero) is given as: Ord('0') = 48. You can see this if you display the result of: Format( 'Ord(''0'') = %d', [Ord('0')] ); since Ord() returns an integer value, and this displays it as a decimal number. The ordinal value of the character '9' is: Ord('9') = 57. However, while the next Hex digit is 'A' (or 'a'), the character following '9' is Chr(58) which = ':' (colon). In practice, Hex digits are not case sensitive, so the hex value of 'a' is the same as the hex value of 'A', both of which correspond to the decimal value of 10 (ten). However, Ord('A') = 65 while Ord('a') = 97. Ord('9') is 57 while Ord('A') = 65. So the ordinal values of the 16 ASCII characters that are used to represent Hex digits is not a continuous array of 16 values from: it goes from Ord('0') = 48 to Ord('F') = 70. The range between those two ends is 22, not 16. And if you use lower-case 'a'..'f' then the difference is Ord('a') - Ord('A'), or the entire range defined as [48 .. 102], again far more than 16 elements. The ordinal value of a string is undefined. So Ord( '0000' ) is an error, neither zero nor 48. Never mind that these are actually BINARY representations (0 or 1), and to the compiler they're just 4-character strings. You have to parse the digits in each position of a Hex number the same way as you do decimal numbers, except you need to multiply each successive position by a power of 16 rather than 10. Simple arrays that serve as lookup tables work for decimal numbers only because the digits zero through nine are contiguous in the ASCII table, and you can simply subtract Ord('0') from the ordinal value of the number you're dealing with to get its actual decimal value. The range of hex characters is NOT contiguous with the ten decimal numbers, and in fact is different based on whether the given hex digit is in upper- or lower-case. So you cannot use simple lookup tables to do this thinking that a range of 16 characters is going to work in all cases. It will work for the ten decimal characters, but NONE of the hex characters. And certainly not for strings expressed as 4-character BINARY (0 + 1) versions of hex digits!
  5. Remy Lebeau

    Intercept "WM_COPY" on Windows

    All the more reason to try the route I suggested. Application A could send its file list to Application B, then B can immediately put CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS items on its local clipboard for each file, having each CFSTR_FILECONTENTS hold an IStream to access its file data. Then, when the user pastes the clipboard somewhere (or an app reads the clipboard directly), the individual CFSTR_FILECONTENTS streams can/will be read from, which can then transfer the actual file data from machine A to B as needed. You could even go as far as having A transfer the file data to B in the background while waiting for a paste to happen, caching the data locally on B, and when CFSTR_FILECONTENTS is read from it can read from the local cache if available, otherwise initiate/wait-for the transfer to finish (even provide the data while it is begin transferred). When the clipboard gets cleared, the IStream's will be released, and their destructors can cancel any transfers in progress and delete any local caches as needed. There are examples/tutorials online about working with CFSTR_FILEDESCRIPTOR/CFSTR_FILECONTENTS, for instance: https://www.codeproject.com/Articles/15576/How-to-drag-a-virtual-file-from-your-app-into-Wind https://www.codeproject.com/Articles/23139/Transferring-Virtual-Files-to-Windows-Explorer-in I'm sure they have, but it is very specialized work, so you are not likely to see it talked about publicly very much.
  6. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma based on @Remy Lebeau text, I have test this code and works... but not guaratee if it's good for all...ok? // VCL tests ... private FClipboardListenerHandle: HWND; procedure ClipboardUpdateHandler(var Msg: TMessage); message WM_CLIPBOARDUPDATE; ... implementation {$R *.dfm} uses Winapi.ShellAPI, Winapi.ShlObj, Vcl.Clipbrd; { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin if AddClipboardFormatListener(Handle) then; // ???? // Memo1.Lines.Add('AddClipboardFormatListener: GetLastError = ' + GetLastError.ToString); end; procedure TForm1.FormDestroy(Sender: TObject); begin if RemoveClipboardFormatListener(Handle) then; /// ??? // Memo1.Lines.Add('RemoveClipboardFormatListener: GetLastError = ' + GetLastError.ToString); end; procedure TForm1.ClipboardUpdateHandler(var Msg: TMessage); var LClipboardData : THandle; LGLobalLock : Pointer; LFilename : PWideChar; LFilenameBuffer: array [0 .. MAX_PATH] of WideChar; // cfShellIDList: UINT; begin if not IsClipboardFormatAvailable(CF_HDROP) then exit; // cfShellIDList := RegisterClipboardFormat(CFSTR_SHELLIDLIST); // if OpenClipboard(Handle) then // opening the Clipboard... begin try LClipboardData := GetClipboardData(CF_HDROP); // some data? // if (LClipboardData > 0) then try LGLobalLock := GlobalLock(LClipboardData); // lock it... try if (LGLobalLock <> nil) then begin DragQueryFileW(HDROP(LGLobalLock), 0, LFilenameBuffer, MAX_PATH); // catch the file/folder name // Memo1.Lines.Add('File name: ' + LFilenameBuffer); end else Memo1.Lines.Add('LGLobalLock = nil'); finally GlobalUnlock(LClipboardData); // unlock it... end; except on E: Exception do Memo1.Lines.Add('Exception: ' + E.Message); end else Memo1.Lines.Add('----- ClipboardData = 0 -----'); finally CloseClipboard; end; end else Memo1.Lines.Add('OpenClipboard = false'); end;
  7. programmerdelphi2k

    SDK API 32 /versions/12 WRITE_EXTERNAL_STORAGE

    https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Standard_RTL_Path_Functions_across_the_Supported_Target_Platforms tutorials for read https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Mobile_Tutorials:_Mobile_Application_Development_(iOS_and_Android) in Android 11, you can not save your files in any folder, basically in your App folder and public folder! the rules to External_storage changed, read more here https://developer.android.com/about/versions/11/privacy/storage
  8. programmerdelphi2k

    Intercept "WM_COPY" on Windows

    @gioma, I think you should avoid using Clipboard, even if it works in your project, for the simple fact that it is a neutral layer and used by any other application in your system. In this way, nothing guarantees that the information obtained will be the desired information. You know it! Now, as you are already communicating with the second (or any other) application on the network, then, I think the most sensible thing would be to approach this direction, that is, send the desired information through TCP/IP, UDP or similar communication ... etc... In this way, you can guarantee that your transmissions will be directed exclusively to your interested applications, that is, to everyone who makes use of this communication, it can be one, two, or as many as you wish. You could easily do this code without much impact on your current project, if you want, you could even create a small TCP/IP server using INDY or whatever to listen on a certain port, and thus receive all messages (information) desired. In this way, you can ensure that you receive the information sent by another application. Delphi can easily generate a DataSnap Server (ie the code) for you to add to your applications. Delphi has Tethering components, which you can easily add to a form, so almost no code is needed. Communication is carried out by TCP/IP and UDP protocols, in this way, you just need to place a Tethering Server component in the applications that will receive the information, and another Tethering Client in the application that will send the information, the rest is just using one or two events to receive the information. Very easy and without much complexity. here a great sample by Malcolm Groves : http://www.malcolmgroves.com/blog/?p=1891
  9. Lars Fosdal

    Fastreports

    https://www.fast-report.com/en/products/report-for-delphi-fastreport-feature-matrix/
  10. Remy Lebeau

    Intercept "WM_COPY" on Windows

    That is the OLD way to monitor the clipboard. Since Vista, the NEW way is using a Clipboard Format Listener instead, registered via AddClipboardFormatListener() and handling WM_CLIPBOARDUPDATE messages. Have you read Microsoft's documentation on Transferring Shell Objects with Drag-and-Drop and the Clipboard and Handling Shell Data Transfer Scenarios yet? Per Shell Clipboard Formats, you will likely want to implement the CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS formats. That way, you can put descriptions of the files onto the clipboard, and when they are pasted then you can stream in the actual file data as needed.
  11. PeterBelow

    Can anyone spot the errors?

    Char (singular) is an ordinal type and can thus be used as index for an array but a string is not an ordinal type. The compiler will convert a single char to a string if required, e.g. if you assign a value/variable of type char to one of type string, but not vice versa. Even a string consisting of only a single character cannot be assigned directly to a variable of type char.
  12. For anyone who struggles with py embeddable in the future, here are some working executables for you to troubleshoot with. Validate your python embeddable setup, confirm package installation and test your imports. FMX and VCL X64 compiled executables in the releases : Source code & sample "_pth" file is available in the GitHub Repo : https://github.com/SwiftExpat/ValidatePythonEmbeddable Usage: Click on browse DLL , this will set the dllname and path correctly and then allow you to adjust other component properties. Then load DLL PIP List Pip results can be confusing, so I have automated the PIP list command to ensure it runs from the embeddedable dist. More should be done for this, but this is a start and feel free to fork the repository or make suggestions.
  13. Probably due to this feature: https://www.indyproject.org/2014/12/22/new-https-functionality-for-tidhttp/ You MUST use an SSLIOHandler if you want to access an HTTPS url. Whether you create your own SSLIOHandler object, or let TIdHTTP create one implicitly, is a separate matter.
×