Jump to content

FPiette

Members
  • Content Count

    1167
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by FPiette

  1. FPiette

    VCL and VCL styles - bugs and future

    Try giving your thread a message pump, and pumping messages while processing the document.
  2. You probably need to read the official documentation. Buying a good book is also useful. You'll find more books at https://delphi-books.com/en/. BTW: It is better you keep asking ONE question per post. I answered only the first...
  3. Don't forget to check older compilers/RTL because this cross platform is not that old.
  4. FPiette

    AliexpressAPI

    I guess you even not tried the link I gave. The first result give all needed explanation. https://developers.aliexpress.com/en/doc.htm?docId=121124&docType=1
  5. FPiette

    AliexpressAPI

    Google is your friend! https://www.google.com/search?q=aliexpress+api
  6. FPiette

    pdfDoc

    Use PowerPdf : Install it using GetIT package manager directly from the IDE. Or visit https://github.com/TurboPack/PowerPDF. It is free. I do it for more than 10 years with great success.
  7. Forget XML. It is slow and memory hungry. Use a TObjectList containing object describing the item. All item objects derive from the same base class having common properties like X,Y, scale, rotate,... Yes, this is the way to go. It is faster to draw in memory and gives a flicker free display update. Anyway you need to draw to an offline bitmap to save the result in a file. You draw all elements to an offline bitmap, including the big parent image and then you display it. You can optimize speed of display by remembering the area which has been updated since la time it has been output to screen. About the library: As I said before you only need graphic primitive. You'll do the rest yourself in your application. To select the library - if ever one is needed because there is already so much in FMX framework - first establish the list of all operations or features you need. Then you can select one.
  8. Reading your post, I think you are looking for a library which does exactly what your application has to do. That would be marvelous but forget it! You actually need a library (or even none since you can use Delphi built-in function) capable of doing primitive graphic manipulation and display. Speaking about the main image - as you name it - your application should have a model of what is expected on screen and a rendering engine. The model is a list of operation applied to images. The list is ordered. By manipulation, I mean and image, and an operation such as position at X/Y coordinate, rotate of a given angle, scale with a given factor, crop this way, mask like that, and so on. The user interaction solely work on the list. When the user want to move an image, you use mouse event and the list to find which (sub)image if on the top and the user want - for example - drag. At each user interaction, you do the rendering. At the end, instead of rendering on screen, you render to a standard bitmap that you write as JPG or other image file format. Got the idea?
  9. FPiette

    Using EdgeBrowser

    Yes, there is: https://blogs.embarcadero.com/execute-scripts-and-view-source-with-tedgebrowser/ Look at subtitle "View The Source".
  10. They work even easier than I thought: When registering a property sheet, it is enough to register it in the SystemFileAssociations. No need to register the class for the file extension nor the file class. To register a property sheet for .foobar files, under de key HKLM\SOFTWARE\Classes\SystemFileAssociations\.foobar\ShellEx\PropertySheetHandlers (May also have to be create) create an entry with the name registered for the COM object implementing the shell extension and set default value to the CLSID. This is an important feature for me to avoid interfering with an existing file type already having a program defined. Tested the behavior with both Win10 and Win11.
  11. On my system, the key HKCR\SystemFileAssociations\.arw exist. I updated my property sheet registration code to write a new key HKCR\SystemFileAssociations\.arw\shellex\PropertySheetHandlers\MyDelphiPropSheetHandler having as default value the CLSID of my property sheet. And Bingo! it works. @Anders Melander you are a master! Congratulations!
  12. Yes, I used ProcessMonitor. It is even among the first things I have done. But there is an incredibly high registry activity from explorer.
  13. Yes, but the property page crashes explorer Just to be sure, you opened a real .arw file (My sample?) by double clicking on his filename in Explorer window and Windows Photo Viewer displayed it correctly. Right?
  14. You have the source: the property page itself contains just a TMemo and no processing is done. Selected files in explorer are displayed (Explorer actually passes paths). I also occasionally saw that message. I couldn't reproduce the condition in which this arrive although I suspect this is when a second instance of the property sheet is opened.
  15. I posted a question there: https://superuser.com/q/1773093/350495
  16. Can you open an .arw file? Yes, it is exactly the same problem. BTW: You should probably upgrade your Win7 to Win11.
  17. You code works correctly for the non existent .foobar file extension. But if I change the file extension to the existing .arw, it doesn't work anymore! Tested on Win10 and Win11 with same result. To change the file extension, I modified 3 code lines in your source: // sFileClass = 'FoobarFile'; // sFileType = 'File of foo'; // sFileExtension = '.foobar'; sFileClass = 'ArwFile'; sFileType = 'File of arw'; sFileExtension = '.arw'; Is it possible for you to test? Before testing, verify that .arw extension exists on your system and you can open a file with that extension. If you have no .arw file, you can download a photo in .ARW format: http://wiki.overbyte.be/arch/FPI09894.ARW If you run Win10, you need to install Microsoft RAW extension from Microsoft store (https://apps.microsoft.com/store/detail/extension-dimage-raw/9NCTDW2W1BH8) It is needed for Win10 but already included by default with Win11. "RAW Extension" cover a bunch of file extension which are a file format used by camera makers. The extension varies with each camera maker. Arw files are from Sony. Canon, Nikon, Panasonic and all other have a specific extension, sometimes several different!
  18. I missed that. Sorry. Thanks!
  19. There are much more changes in my code than the excerpts you published. Would you publish or send to me the full source code as you modified?
  20. Thank you so much for the hint. I have to study that code to understand which keys it register. I added it manually, it doesn't make it works. I don't understand what you are talking about. Do you mean my source code layout?
  21. I did not create the "HKLM\SOFTWARE\Classes\CLSID\{AF6B...}\ProgID" subkey. It is created by the code in ComObj to register the COM object. This is in TComObjectFactory.UpdateRegistry line 985 in Delphi 11.3 System.Win.ComObj.pas. I assume this is normal way of doing the registration. Removing that subkey doesn't change anything.
  22. Wonderful. From the screen dump I cannot determine that the property sheet handler is registered for all extensions (That work here also) or for a single one (Don't work here). If REG_FILENAME symbol is defined, my code will register for a single file extension (.arw in my original code), that is what you need to try. I will really be grateful for that code.
  23. First thing first, I try with a single extension: .arw. Then I'll update the code when required for multiple extensions, that's not the issue.
  24. The registry structure is what @Remy Lebeaushowed in his constructive answer and is conform to Microsoft documentation and yet it doesn't work. Using registry I checked that my code create the keys as specified by Microsoft (see below). Entering something manually? OK but what? That's the question. I miss something and I don't know what. If I don't publish code, someone (you for example) will say "Show what you tried...". That's why I copied relevant code here and made complete project available. Lines marked "<= Not me" was existing before. I write in HKLM\SOFTWARE\Classes and Windows automatically replicate the keys in HKCR. On my system, there is no property sheet that I can analyze and reproduce the structure.
  25. I have coded that. And it doesn't work at all. Here is the code: procedure TMyDelphiPropSheetHandlerFactory.UpdateRegistry(ARegister: Boolean); const Key = '*\shellex\PropertySheetHandlers\'; var Reg : TRegistry; ClassID : String; {$IFDEF REG_FILENAME} ProgNameVer : String; RegExtArray : TStringDynArray; Ext : String; ExtCount : Integer; ProgID : String; ProgTmp : String; {$ENDIF} begin ClassID := GUIDToString(Class_MyDelphiPropSheetHandler); Reg := TRegistry.Create; try {$IFDEF REG_FILENAME} if ARegister then inherited UpdateRegistry(ARegister); Reg.RootKey := HKEY_LOCAL_MACHINE; ProgNameVer := ProgName + '.' + ProgVer; RegExtArray := SplitString(RegFileExts, ';'); if ARegister then begin // Register if Length(RegExtArray) > 0 then begin ExtCount := 0; for Ext in RegExtArray do begin if not Reg.OpenKey('\Software\Classes\' + Ext, FALSE) then MyMessageBox('File type "%s" doesn''t exists', [Ext]) else begin Inc(ExtCount); ProgID := Reg.ReadString(''); if ProgID = '' then begin ProgID := ProgNameVer; Reg.WriteString('', ProgID); MyMessageBox('Created ProgID[%s]="%s"', [Ext, ProgID]); Reg.CloseKey; if not Reg.OpenKey('\Software\Classes\' + ProgID, FALSE) then begin Reg.OpenKey('\Software\Classes\' + ProgID, TRUE); MyMessageBox('Created key "\Software\Classes\%s"', [ProgID]); end; end else MyMessageBox('ProgID[%s]="%s"', [Ext, ProgID]); Reg.CloseKey; if ExtCount = 1 then begin if Reg.OpenKey('\Software\Classes\' + ProgID + '\ShellEx\PropertySheetHandlers\' + ProgName, TRUE) then begin Reg.WriteString('', ClassID); Reg.CloseKey; MyMessageBox('PropertySheetHandlers[%s]="%s"', [Ext, ProgName]); end; end; MyMessageBox('Registered for Ext="%s"', [Ext]); SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil); end; end; end; end else begin // Unregister ProgID := ProgName + '.' + ProgVer; if Length(RegExtArray) > 0 then begin for Ext in RegExtArray do begin if Reg.OpenKey('\Software\Classes\' + Ext, FALSE) then begin ProgTmp := Reg.ReadString(''); if SameText(ProgID, ProgTmp) then begin Reg.DeleteValue(''); MyMessageBox('Deleted ProgID="%s" for Ext="%s"', [ProgID, Ext]); end; end; end; end; if Reg.OpenKey('\Software\Classes\' + ProgNameVer, False) then Reg.DeleteKey('\Software\Classes\' + ProgNameVer); inherited UpdateRegistry(ARegister); end; {$ELSE} inherited UpdateRegistry(ARegister); Reg.RootKey := HKEY_CLASSES_ROOT; if ARegister then begin if Reg.OpenKey('\*\ShellEx\PropertySheetHandlers\' + ProgName, True) then Reg.WriteString('', ClassID) else MyMessageBox('UpdateRegistry : Can''t open registry key!'); end else begin if Reg.OpenKey('\*\ShellEx\PropertySheetHandlers\' + ProgName, False) then begin if not Reg.DeleteKey('\*\ShellEx\PropertySheetHandlers\' + ProgName) then MyMessageBox('Registry key *NOT* deleted!'); end; end; {$ENDIF} finally Reg.CloseKey; Reg.Free; end; end; As you can see, the symbol REG_FILENAME which select registration for all files or single file name extension. MyMessageBox is a message box that I use for debugging. The registration for all file name extension work nicely, so I'm sure the property sheet code is correct. Only the registration for a single extension doesn't work (no error, just do nothing). The complete source code is there: MyDelphiPropSheetHandlerSourceCode.zip There is also an image in .arw file format to test: http://wiki.overbyte.be/arch/FPI09894.ARW BTW: The property sheet does nothing except displaying the selected files in a TMemo.
×